From df31cc81cdb2bd0558e79115065922609aea1f2f Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Fri, 8 Apr 2011 03:15:52 +1200 Subject: [PATCH] Delete empty lines at the end of the tagbar buffer --- plugin/tagbar.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugin/tagbar.vim b/plugin/tagbar.vim index 1b4f9d5..f410034 100644 --- a/plugin/tagbar.vim +++ b/plugin/tagbar.vim @@ -1850,6 +1850,15 @@ function! s:RenderContent(...) " Print tags call s:PrintKinds(typeinfo, fileinfo) + " Delete empty lines at the end of the buffer + for linenr in range(line('$'), 1, -1) + if getline(linenr) =~ '^$' + execute linenr . 'delete' + else + break + endif + endfor + setlocal nomodifiable if !empty(s:known_files.getCurrent()) &&