From 84afd8e80217f5757a74522201c4610e79e07611 Mon Sep 17 00:00:00 2001 From: David Hegland Date: Mon, 24 May 2021 09:28:01 -0500 Subject: [PATCH] Remove open buffer from known files on bdelete or bwipe (#768) Closes #750 On `:bdelete` or `:bwipe` of a file, remove the file from the known file listing even if the tagbar window is not open. Previously was only removing the file if the tagbar window was open. --- autoload/tagbar.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 12827e7..09b6888 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -3463,13 +3463,13 @@ function! s:HandleBufDelete(bufname, bufnr) abort return endif + call s:known_files.rm(fnamemodify(a:bufname, ':p')) + let tagbarwinnr = bufwinnr(s:TagbarBufName()) if tagbarwinnr == -1 || a:bufname =~# '__Tagbar__.*' return endif - call s:known_files.rm(fnamemodify(a:bufname, ':p')) - if !s:HasOpenFileWindows() if tabpagenr('$') == 1 && exists('t:tagbar_buf_name') " The last normal window closed due to a :bdelete/:bwipeout.