1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-17 11:30:28 +01:00

Add TagbarJump (#515)

Co-authored-by: Sundström Valter <mail@valter.nu>
Co-authored-by: David Hegland <david.hegland@broadcom.com>
This commit is contained in:
Valter Sundström
2021-01-12 05:41:44 +01:00
committed by GitHub
parent 6f02f1f852
commit 2a36ad79a7
3 changed files with 25 additions and 0 deletions

View File

@@ -3969,5 +3969,14 @@ function! tagbar#IsOpen() abort
endif
endfunction
" tagbar#jump() {{{2
function! tagbar#jump() abort
if &filetype !=# 'tagbar'
" Not in tagbar window - ignore this function call
return
endif
call s:JumpToTag(1)
endfun
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1

View File

@@ -318,6 +318,13 @@ COMMANDS *tagbar-commands*
the file size limit. So if the file is written and needs to be processed
again, this command will need to be re-executed.
:TagbarJump *:TagbarJump*
Jump to the tag under the cursor. This only works while the cursor is in
the tagbar window. This will leave the cursor in the tagbar window. It is
the same behavior as the |p| key mapping.
This command will call the |tagbar#jump()| function.
------------------------------------------------------------------------------
FUNCTIONS *tagbar-functions*
@@ -360,6 +367,13 @@ FUNCTIONS *tagbar-functions*
This function will return 1 if the tagbar window is open, else it will
return 0.
*tagbar#jump()*
Jump to the tag under the cursor. This only works while the cursor is in
the tagbar window. This will leave the cursor in the tagbar window. It is
the same behavior as the |p| key mapping.
This is the function called when using the |:TagbarJump| command.
------------------------------------------------------------------------------
KEY MAPPINGS *tagbar-keys*

View File

@@ -195,6 +195,8 @@ command! -nargs=? TagbarDebug call tagbar#debug#start_debug(<f-args>)
command! -nargs=0 TagbarDebugEnd call tagbar#debug#stop_debug()
command! -nargs=0 TagbarTogglePause call tagbar#toggle_pause()
command! -nargs=0 TagbarForceUpdate call tagbar#ForceUpdate()
command! -nargs=0 TagbarJump call tagbar#jump()
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1