diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 52b9210..9109d49 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -1597,9 +1597,6 @@ function! s:OpenWindow(flags) abort if tagbarwinnr != -1 if winnr() != tagbarwinnr && jump call s:winexec(tagbarwinnr . 'wincmd w') - if autoclose - let w:autoclose = autoclose - endif call s:HighlightTag(1, curline) endif call s:LogDebugMessage("OpenWindow finished, Tagbar already open") diff --git a/doc/tagbar.txt b/doc/tagbar.txt index 0531650..f7b3427 100644 --- a/doc/tagbar.txt +++ b/doc/tagbar.txt @@ -241,7 +241,8 @@ COMMANDS *tagbar-commands* were set to 1) 'j' Jump to Tagbar window if already open 'c' Close Tagbar on tag selection (just as if |g:tagbar_autoclose| were - set to 1, but doesn't imply 'f') + set to 1, but doesn't imply 'f'), but only if the Tagbar window was + opened using this command. For example, the following command would always jump to the Tagbar window, opening it first if necessary, but keep it open after selecting a tag @@ -256,7 +257,7 @@ COMMANDS *tagbar-commands* :TagbarOpenAutoClose *:TagbarOpenAutoClose* Open the Tagbar window, jump to it and close it on tag selection. This is - an alias for ":TagbarOpen fc". + an alias for ":TagbarOpen fjc". :TagbarSetFoldlevel[!] {number} *:TagbarSetFoldlevel* Set the foldlevel of the tags of the current file to {number}. The diff --git a/plugin/tagbar.vim b/plugin/tagbar.vim index 4d20f16..9d8232a 100644 --- a/plugin/tagbar.vim +++ b/plugin/tagbar.vim @@ -103,7 +103,7 @@ augroup END " Commands {{{1 command! -nargs=0 TagbarToggle call tagbar#ToggleWindow() command! -nargs=? TagbarOpen call tagbar#OpenWindow() -command! -nargs=0 TagbarOpenAutoClose call tagbar#OpenWindow('fc') +command! -nargs=0 TagbarOpenAutoClose call tagbar#OpenWindow('fcj') command! -nargs=0 TagbarClose call tagbar#CloseWindow() command! -nargs=1 -bang TagbarSetFoldlevel call tagbar#SetFoldLevel(, 0) command! -nargs=0 TagbarShowTag call tagbar#OpenParents()