Skip to content

Commit

Permalink
Check bufnr and bufname before closing
Browse files Browse the repository at this point in the history
Refs #335
  • Loading branch information
kien committed Dec 24, 2012
1 parent 675faa7 commit 6c49f2a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions autoload/ctrlp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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(...)
Expand Down

0 comments on commit 6c49f2a

Please sign in to comment.