1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-17 11:30:28 +01:00

Play nicely with popup windows (#604)

This commit is contained in:
cridemichel
2020-05-05 14:47:01 +02:00
committed by GitHub
parent 1e50ea8536
commit 2a1486447a

View File

@@ -3371,6 +3371,18 @@ endfunction
" s:goto_win() {{{2
function! s:goto_win(winnr, ...) abort
"Do not go to a popup window to avoid errors.
"Hence, check first if a:winnr is an integer,
"if this integer is equal to 0,
"the window is a popup window
if has('popupwin')
if type(a:winnr) == type(0) && a:winnr == 0
return
endif
if a:winnr ==# 'p' && winnr('#') == 0
return
endif
endif
let cmd = type(a:winnr) == type(0) ? a:winnr . 'wincmd w'
\ : 'wincmd ' . a:winnr
let noauto = a:0 > 0 ? a:1 : 0