From 7bbe4054de35b69f4ead66c5518aeefb872c02b4 Mon Sep 17 00:00:00 2001 From: Kien N Date: Thu, 28 Feb 2013 20:45:18 +0700 Subject: [PATCH] Call s:Close() directly --- autoload/ctrlp.vim | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim index 9a6ac6a..d11bbff 100644 --- a/autoload/ctrlp.vim +++ b/autoload/ctrlp.vim @@ -264,9 +264,13 @@ endf fu! s:Close() cal s:buffunc(0) - try | bun! - cat | clo! | endt - cal s:unmarksigns() + if winnr('$') == 1 + bw! + el + try | bun! + cat | clo! | endt + cal s:unmarksigns() + en for key in keys(s:glbs) | if exists('+'.key) sil! exe 'let &'.key.' = s:glb_'.key en | endfo @@ -759,8 +763,8 @@ endf fu! s:PrtExit() if bufnr('%') == s:bufnr && bufname('%') == 'ControlP' - if !has('autocmd') | cal s:Close() | en - exe ( winnr('$') == 1 ? 'bw!' : 'winc p' ) + noa cal s:Close() + noa winc p en endf