From 577cf5caa44807a8a9fb943f6e1feb33793897cb Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 8 Oct 2016 17:00:55 +0200 Subject: [PATCH] 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. --- plug.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plug.vim b/plug.vim index 1da64a9..2b413b4 100644 --- a/plug.vim +++ b/plug.vim @@ -726,10 +726,17 @@ function! s:prepare(...) call s:job_abort() if s:switch_in() + let new_window = winnr('$') > 1 normal q + else + let new_window = 1 endif - call s:new_window() + if new_window + call s:new_window() + else + enew + endif nnoremap q :if b:plug_preview==1pcendifbd if a:0 == 0 call s:finish_bindings()