use g:tagbar_highlight_method as default in tagbar#currenttag and forward search method from :TagbarCurrentTag (#803)

* allow to specify {search-method} in :TagbarCurrentTag command

* tagbar#currenttag now uses g:tagbar_highlight_method as default search method
This commit is contained in:
magras 2022-01-11 19:41:32 +03:00 committed by GitHub
parent 0441c1c6d9
commit 3188ab1ee8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -3901,13 +3901,13 @@ function! tagbar#currenttag(fmt, default, ...) abort
if a:0 >= 2
let search_method = a:2
else
let search_method = 'nearest-stl'
let search_method = g:tagbar_highlight_method
endif
else
let longsig = 0
let fullpath = 0
let prototype = 0
let search_method = 'nearest-stl'
let search_method = g:tagbar_highlight_method
endif
if !s:Init(1)

View File

@ -295,9 +295,9 @@ COMMANDS *tagbar-commands*
Open the parent folds of the current tag in the file window as much as
needed for the tag to be visible in the Tagbar window.
:TagbarCurrentTag [{flags}] *:TagbarCurrentTag*
Echo the current tag in the command line. For {flags} see
|tagbar-statusline|.
:TagbarCurrentTag [{flags} [{search-method}]] *:TagbarCurrentTag*
Echo the current tag in the command line. For {flags} and {search-method}
see |tagbar-statusline|.
:TagbarGetTypeConfig {filetype} *:TagbarGetTypeConfig*
Paste the Tagbar configuration of the vim filetype {filetype} at the

View File

@ -190,7 +190,7 @@ 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#highlighttag(1, 1)
command! -nargs=? TagbarCurrentTag echo tagbar#currenttag('%s', 'No current tag', <f-args>)
command! -nargs=* TagbarCurrentTag echo tagbar#currenttag('%s', 'No current tag', <f-args>)
command! -nargs=1 TagbarGetTypeConfig call tagbar#gettypeconfig(<f-args>)
command! -nargs=? TagbarDebug call tagbar#debug#start_debug(<f-args>)
command! -nargs=0 TagbarDebugEnd call tagbar#debug#stop_debug()