Make 'open' commands a bit more intuitive

This commit is contained in:
Jan Larres 2012-07-31 16:42:18 +12:00
parent e690a5e97d
commit f3c1a93017
3 changed files with 4 additions and 6 deletions

View File

@ -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")

View File

@ -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

View File

@ -103,7 +103,7 @@ augroup END
" Commands {{{1
command! -nargs=0 TagbarToggle call tagbar#ToggleWindow()
command! -nargs=? TagbarOpen call tagbar#OpenWindow(<f-args>)
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(<args>, <bang>0)
command! -nargs=0 TagbarShowTag call tagbar#OpenParents()