mirror of
https://github.com/gryf/tagbar.git
synced 2025-12-17 19:40:27 +01:00
Do not interfere window switching history
Many plugins rely on 'wincmd p' to work properly, we need to preserve at least one-level backwards window switching history.
This commit is contained in:
committed by
Jan Larres
parent
bccdc7a48d
commit
ad8783961d
@@ -2411,7 +2411,14 @@ function! s:RenderContent(...) abort
|
||||
let in_tagbar = 1
|
||||
else
|
||||
let in_tagbar = 0
|
||||
let currwinnr = winnr()
|
||||
|
||||
" Get the previous window number, so that we can reproduce
|
||||
" the window entering history later. Do not run autocmd on
|
||||
" this command, make sure nothing is interfering.
|
||||
call s:winexec('noautocmd wincmd p')
|
||||
let prevwinnr = winnr()
|
||||
|
||||
call s:winexec(tagbarwinnr . 'wincmd w')
|
||||
endif
|
||||
|
||||
@@ -2476,6 +2483,7 @@ function! s:RenderContent(...) abort
|
||||
|
||||
if !in_tagbar
|
||||
call s:winexec(prevwinnr . 'wincmd w')
|
||||
call s:winexec(currwinnr . 'wincmd w')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user