mirror of
https://github.com/preservim/tagbar.git
synced 2025-02-14 03:42:46 +08:00
Don't highlight the same tag again, closes #36
This commit is contained in:
parent
3c075654d4
commit
9a6e21e44d
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user