Check bufnr and bufname before closing

Refs #335
This commit is contained in:
Kien N 2012-12-25 04:33:14 +07:00
parent 675faa77f8
commit 6c49f2a5b2

View File

@ -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(...)