From 4ca7a0c6364079fc7d5ce7494fd826d28ce7f59a Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Mon, 18 Feb 2013 21:51:16 +1300 Subject: [PATCH] Prevent update error when current file is empty --- autoload/tagbar.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 92a363c..d581c48 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -3111,7 +3111,8 @@ function! s:AutoUpdate(fname, force) abort " Display the tagbar content if the tags have been updated or a different " file is being displayed if bufwinnr('__Tagbar__') != -1 && - \ (s:new_window || updated || a:fname != s:known_files.getCurrent().fpath) + \ (s:new_window || updated || + \ (!empty(s:known_files.getCurrent()) && a:fname != s:known_files.getCurrent().fpath)) call s:RenderContent(fileinfo) endif