Closed raven42 closed 3 years ago
Not providing a default keymap as this affects the actual file window and we don't want to change something the user may already have set. The function calls and new commands will be enough and the user can provide their own keymapping in their .vimrc
to provide the correct mapping.
Recommended keymap:
nnoremap t[ :TagbarJumpPrev<CR>
nnoremap t] :TagbarJumpNext<CR>
Closes #779
Updated functions:
s:GetNearbyTag()
- Allow for a direction parameter to be passed into the routine. This will allow for a forward or backward search. It will default to a backward search line the current behavior if thea:direction
parameter is not used.s:JumpToTag()
- Allow for an optional parameter to be passed in to specify the tag instead of using the tag under the cursor on the current line. This also allows this routine to be executed from the file window instead of the tagbar window. Assumeautoclose=0
if passing in the tag.Add new functions:
s:JumpToNearbyTag()
- This routine will do a forward or backward search for the nearst tag using theGetNearbyTag()
with the new direction field, then call theJumpToTag()
with the tag we found.tagbar#jumpToNextTag()
- New public facing wrapper routine around theJumpToNearbyTag()
routine. Optionally take ina:lnum
anda:search_method
to be used in other routines. Ifa:lnum
is not present, then the line number will search from the next or previous line depending on thea:direction
value.TODO:
.vimrc
.