From 0441c1c6d9b39249503bc816c7a4e5895f72729e Mon Sep 17 00:00:00 2001 From: as Date: Wed, 8 Dec 2021 23:49:40 +0100 Subject: [PATCH] Add support of TagbarOpen arguments for TagbarToggle (#800) --- doc/tagbar.txt | 6 ++++-- plugin/tagbar.vim | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/tagbar.txt b/doc/tagbar.txt index b8aebd7..74e54ea 100644 --- a/doc/tagbar.txt +++ b/doc/tagbar.txt @@ -270,9 +270,11 @@ COMMANDS *tagbar-commands* :TagbarClose *:TagbarClose* Close the Tagbar window if it is open. -:TagbarToggle *:TagbarToggle* -:Tagbar +:TagbarToggle [{flags}] *:TagbarToggle* +:Tagbar [{flags}] Open the Tagbar window if it is closed, or close it if it is open. + Additional behaviour can be specified with the same optional {flags} + argument as :TagbarOpen. :TagbarOpenAutoClose *:TagbarOpenAutoClose* Open the Tagbar window, jump to it and close it on tag selection. This is diff --git a/plugin/tagbar.vim b/plugin/tagbar.vim index 390434b..3c00b40 100644 --- a/plugin/tagbar.vim +++ b/plugin/tagbar.vim @@ -183,8 +183,8 @@ augroup TagbarSession augroup END " Commands {{{1 -command! -nargs=0 Tagbar call tagbar#ToggleWindow() -command! -nargs=0 TagbarToggle call tagbar#ToggleWindow() +command! -nargs=? Tagbar call tagbar#ToggleWindow() +command! -nargs=? TagbarToggle call tagbar#ToggleWindow() command! -nargs=? TagbarOpen call tagbar#OpenWindow() command! -nargs=0 TagbarOpenAutoClose call tagbar#OpenWindow('fcj') command! -nargs=0 TagbarClose call tagbar#CloseWindow()