From 6c49f2a5b28547987966be3e34dec193a9396c59 Mon Sep 17 00:00:00 2001 From: Kien N Date: Tue, 25 Dec 2012 04:33:14 +0700 Subject: [PATCH] Check bufnr and bufname before closing Refs #335 --- autoload/ctrlp.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim index aea5258..97fd3df 100644 --- a/autoload/ctrlp.vim +++ b/autoload/ctrlp.vim @@ -759,8 +759,10 @@ fu! s:PrtDeleteMRU() endf fu! s:PrtExit() - if !has('autocmd') | cal s:Close() | en - exe ( winnr('$') == 1 ? 'bw!' : 'winc p' ) + if bufnr('%') == s:bufnr && bufname('%') == 'ControlP' + if !has('autocmd') | cal s:Close() | en + exe ( winnr('$') == 1 ? 'bw!' : 'winc p' ) + en endf fu! s:PrtHistory(...)