Reuse plug window even if it's in another tab

This commit is contained in:
Junegunn Choi 2014-10-10 10:23:00 +09:00
parent ee9f0e55b8
commit 8c915a5271

View File

@ -498,7 +498,8 @@ function! s:new_window()
endfunction
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
function! s:switch_in()
@ -533,15 +534,7 @@ endfunction
function! s:prepare()
call s:job_abort()
if bufexists(s:plug_buf)
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
if s:switch_in()
silent %d _
else
call s:new_window()