diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index a2fcc56..a47db7b 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -984,8 +984,7 @@ function! s:CreateAutocommands() abort " was changed by an external command; see commit 17d199f autocmd BufReadPost,BufEnter,CursorHold,FileType * call \ s:AutoUpdate(fnamemodify(expand(''), ':p'), 0) - autocmd BufDelete,BufWipeout * call - \ s:known_files.rm(fnamemodify(expand(''), ':p')) + autocmd BufDelete,BufWipeout * call s:RemoveFileinfo(expand('')) autocmd QuickFixCmdPre * let s:tagbar_qf_active = 1 autocmd QuickFixCmdPost * if exists('s:tagbar_qf_active') | @@ -3698,6 +3697,13 @@ function! s:IsValidFile(fname, ftype) abort return 1 endfunction +" s:RemoveFileinfo() {{{2 +function! s:RemoveFileinfo(file) abort + let file = fnamemodify(a:file, ':p') + call s:debug('Removing fileinfo for [' . file . ']') + call s:known_files.rm(file) +endfunction + " s:SetStatusLine() {{{2 function! s:SetStatusLine(current) " Make sure we're actually in the Tagbar window