Skip to content

Commit

Permalink
Remove open buffer from known files on bdelete or bwipe (preservim#768)
Browse files Browse the repository at this point in the history
Closes preservim#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.
  • Loading branch information
dev-hann committed May 24, 2021
1 parent 80cf7b5 commit 14f1fcc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autoload/tagbar.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 14f1fcc

Please sign in to comment.