Use :enew instead of :new when being the only window

After `:only` in the vim-plug window, `:PlugUpdate` currently results in
a split window, but I think it is better to keep it as the single window
in that case.
This commit is contained in:
Daniel Hahler 2016-10-08 17:00:55 +02:00
parent 7bad3e7802
commit 577cf5caa4

View File

@ -726,10 +726,17 @@ function! s:prepare(...)
call s:job_abort() call s:job_abort()
if s:switch_in() if s:switch_in()
let new_window = winnr('$') > 1
normal q normal q
else
let new_window = 1
endif endif
if new_window
call s:new_window() call s:new_window()
else
enew
endif
nnoremap <silent> <buffer> q :if b:plug_preview==1<bar>pc<bar>endif<bar>bd<cr> nnoremap <silent> <buffer> q :if b:plug_preview==1<bar>pc<bar>endif<bar>bd<cr>
if a:0 == 0 if a:0 == 0
call s:finish_bindings() call s:finish_bindings()