1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-18 03:50:26 +01:00

Close preview window when closing Tagbar

This commit is contained in:
Jan Larres
2013-11-22 16:43:06 +13:00
parent e090fe73d1
commit 915b11bd1c

View File

@@ -58,6 +58,7 @@ let s:winrestcmd = ''
let s:short_help = 1
let s:nearby_disabled = 0
let s:paused = 0
let s:pedit_by_tagbar = 0
let s:window_expanded = 0
let s:expand_bufnr = -1
@@ -70,7 +71,6 @@ let s:window_pos = {
" take extra arguments
let s:compare_typeinfo = {}
let s:visibility_symbols = {
\ 'public' : '+',
\ 'protected' : '#',
@@ -1842,6 +1842,11 @@ function! s:CloseWindow() abort
return
endif
" Close the preview window if it was opened by us
if s:pedit_by_tagbar
pclose
endif
let tagbarbufnr = winbufnr(tagbarwinnr)
if winnr() == tagbarwinnr
@@ -3014,6 +3019,9 @@ function! s:ShowInPreviewWin() abort
execute g:tagbar_previewwin_pos . ' pedit +' . taginfo.fields.line . ' ' .
\ s:known_files.getCurrent(0).fpath
" Remember that the preview window was opened by Tagbar so we can safely
" close it by ourselves
let s:pedit_by_tagbar = 1
call s:goto_win('P')
normal! zv