mirror of
https://github.com/gryf/tagbar.git
synced 2026-10-06 21:50:36 +02:00
Don't highlight the same tag again, closes #36
This commit is contained in:
1 parent
3c075654d4
commit
9a6e21e44d
1 file changed
+14
@@ -90,6 +90,8 @@ let s:access_symbols = {
|
||||
|
||||
let g:loaded_tagbar = 1
|
||||
|
||||
let s:last_highlight_tline = 0
|
||||
|
||||
" s:InitTypes() {{{2
|
||||
function! s:InitTypes()
|
||||
let s:known_types = {}
|
||||
@@ -2059,6 +2061,9 @@ function! s:RenderContent(...)
|
||||
" window by jumping to the top after drawing
|
||||
execute 1
|
||||
call winline()
|
||||
|
||||
" Invalidate highlight cache from old file
|
||||
let s:last_highlight_tline = 0
|
||||
endif
|
||||
|
||||
let &lazyredraw = lazyredraw_save
|
||||
@@ -2235,6 +2240,15 @@ function! s:HighlightTag()
|
||||
let tagline = tag.tline
|
||||
endif
|
||||
|
||||
" Don't highlight the tag again if it's the same one as last time.
|
||||
" This prevents the Tagbar window from jumping back after scrolling with
|
||||
" the mouse.
|
||||
if tagline == s:last_highlight_tline
|
||||
return
|
||||
else
|
||||
let s:last_highlight_tline = tagline
|
||||
endif
|
||||
|
||||
let eventignore_save = &eventignore
|
||||
set eventignore=all
|
||||
|
||||
|
||||
Reference in new issue
Block a user