mirror of
https://github.com/junegunn/vim-plug.git
synced 2025-12-08 09:54:45 +08:00
Reuse plug window even if it's in another tab
This commit is contained in:
13
plug.vim
13
plug.vim
@@ -498,7 +498,8 @@ function! s:new_window()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:plug_window_exists()
|
function! s:plug_window_exists()
|
||||||
return index(tabpagebuflist(s:plug_tab), s:plug_buf) >= 0
|
let buflist = tabpagebuflist(s:plug_tab)
|
||||||
|
return !empty(buflist) && index(buflist, s:plug_buf) >= 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:switch_in()
|
function! s:switch_in()
|
||||||
@@ -533,15 +534,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:prepare()
|
function! s:prepare()
|
||||||
call s:job_abort()
|
call s:job_abort()
|
||||||
if bufexists(s:plug_buf)
|
if s:switch_in()
|
||||||
let winnr = bufwinnr(s:plug_buf)
|
|
||||||
if winnr < 0
|
|
||||||
call s:new_window()
|
|
||||||
execute 'buffer' s:plug_buf
|
|
||||||
else
|
|
||||||
execute winnr 'wincmd w'
|
|
||||||
endif
|
|
||||||
setlocal modifiable
|
|
||||||
silent %d _
|
silent %d _
|
||||||
else
|
else
|
||||||
call s:new_window()
|
call s:new_window()
|
||||||
|
|||||||
Reference in New Issue
Block a user