Permalink
Browse files

Check bufnr and bufname before closing

Refs #335
  • Loading branch information...
1 parent 675faa7 commit 6c49f2a5b28547987966be3e34dec193a9396c59 @kien committed Dec 24, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 autoload/ctrlp.vim
View
@@ -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(...)

0 comments on commit 6c49f2a

Please sign in to comment.