mirror of
https://github.com/preservim/tagbar.git
synced 2025-02-14 21:42:46 +08:00
Add g:tagbar_highlight_follow_insert
option (#725)
This adds an option making the highlight in the Tagbar follow the cursor in insert mode as well. This feature is guarded behind an option because it may introduce some delay in the input. GitHub: closes #724
This commit is contained in:
parent
778d41f437
commit
6f02f1f852
|
@ -576,6 +576,10 @@ function! s:CreateAutocommands() abort
|
|||
" was changed by an external command; see commit 17d199f
|
||||
autocmd BufReadPost,BufEnter,CursorHold,FileType * call
|
||||
\ s:AutoUpdate(fnamemodify(expand('<afile>'), ':p'), 0)
|
||||
if g:tagbar_highlight_follow_insert
|
||||
autocmd CursorHoldI * call
|
||||
\ s:AutoUpdate(fnamemodify(expand('<afile>'), ':p'), 0)
|
||||
endif
|
||||
autocmd BufDelete,BufWipeout *
|
||||
\ nested call s:HandleBufDelete(expand('<afile>'), expand('<abuf>'))
|
||||
|
||||
|
|
|
@ -1094,6 +1094,19 @@ containing the tag without scrolling the window. If the tag is not visible
|
|||
in the window then the window will be scrolled and the tag (and cursor)
|
||||
placed in the location dictated by |g:tagbar_jump_offset|.
|
||||
|
||||
*g:tagbar_highlight_follow_insert*
|
||||
g:tagbar_highlight_follow_insert~
|
||||
Default: 0
|
||||
|
||||
If set to non-zero, the highlight of the current tag in the Tagbar will follow
|
||||
the cursor in insert mode as well, after a short pause once the cursor stops
|
||||
moving. Enabling this option may introduce some lag during the input, so it is
|
||||
disabled by default.
|
||||
|
||||
Example:
|
||||
>
|
||||
let g:tagbar_highlight_follow_insert = 1
|
||||
<
|
||||
*g:tagbar_highlight_method*
|
||||
g:tagbar_highlight_method~
|
||||
Default: 'nearest-stl'
|
||||
|
|
|
@ -100,6 +100,7 @@ function! s:setup_options() abort
|
|||
\ ['jump_lazy_scroll', 0],
|
||||
\ ['left', 0],
|
||||
\ ['help_visibility', 0],
|
||||
\ ['highlight_follow_insert', 0],
|
||||
\ ['highlight_method', 'nearest-stl'],
|
||||
\ ['ignore_anonymous', 0],
|
||||
\ ['position', default_pos],
|
||||
|
|
Loading…
Reference in New Issue
Block a user