Skip to content

Commit

Permalink
Avoid to start on cmdwin.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed May 2, 2012
1 parent 8820dec commit 59aa11f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions autoload/ctrlp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,15 @@ fu! s:SetDefTxt()
en
let s:prompt[0] = txt
endf
" - IsCmdWin() {{{1
fu! s:IsCmdWin()
silent! verbose noautocmd wincmd p
if v:errmsg =~ '^E11:'
return 1
endif
silent! noautocmd wincmd p
return 0
endf
" ** Prt Actions {{{1
" Editing {{{2
fu! s:PrtClear()
Expand Down Expand Up @@ -1735,6 +1744,7 @@ endf

fu! ctrlp#init(type, ...)
if exists('s:init') | retu | en
if s:IsCmdWin() | retu | en
let [s:matches, s:init] = [1, 1]
cal ctrlp#reset()
cal s:Open()
Expand Down

0 comments on commit 59aa11f

Please sign in to comment.