mirror of
https://github.com/preservim/tagbar.git
synced 2025-02-14 21:42:46 +08:00
Only set ballooneval while in tagbar window (#805)
ballooneval is a global option, so setting it while initialising tagbar permanently enables ballooneval functionality for the GUI, overriding the vim default (disabled) or a user explicitly setting noballooneval. To address this, only set ballooneval when entering the tagbar window, and restore the original ballooneval setting when leaving the window. This is not perfect, but there is precedent, Netrw behaves like this.
This commit is contained in:
parent
3188ab1ee8
commit
88242397b4
|
@ -563,6 +563,16 @@ function! s:CreateAutocommands() abort
|
|||
autocmd WinEnter __Tagbar__.* call s:SetStatusLine()
|
||||
autocmd WinLeave __Tagbar__.* call s:SetStatusLine()
|
||||
|
||||
if g:tagbar_show_balloon == 1 && has('balloon_eval')
|
||||
autocmd WinEnter __Tagbar__.*
|
||||
\ let s:beval = &beval |
|
||||
\ set ballooneval
|
||||
autocmd WinLeave __Tagbar__.*
|
||||
\ if exists("s:beval") |
|
||||
\ let &beval = s:beval |
|
||||
\ endif
|
||||
endif
|
||||
|
||||
if g:tagbar_autopreview
|
||||
autocmd CursorMoved __Tagbar__.* nested call s:ShowInPreviewWin()
|
||||
endif
|
||||
|
@ -989,7 +999,6 @@ function! s:InitWindow(autoclose) abort
|
|||
|
||||
if g:tagbar_show_balloon == 1 && has('balloon_eval')
|
||||
setlocal balloonexpr=TagbarBalloonExpr()
|
||||
set ballooneval
|
||||
endif
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user