Limit default input to path related modes

This commit is contained in:
Kien N 2012-04-09 01:21:50 +07:00
parent 38831712e8
commit cb25e84cce

View File

@ -462,7 +462,7 @@ fu! s:BuildPrompt(upd, ...)
endf endf
" - SetDefTxt() {{{1 " - SetDefTxt() {{{1
fu! s:SetDefTxt() fu! s:SetDefTxt()
if s:deftxt == '0' || s:pathmode == 1 | retu | en if s:deftxt == '0' || s:pathmode == 1 || !s:ispath | retu | en
let txt = s:deftxt let txt = s:deftxt
if !type(txt) if !type(txt)
let txt = txt && !stridx(s:crfpath, s:dyncwd) let txt = txt && !stridx(s:crfpath, s:dyncwd)
@ -1638,10 +1638,10 @@ fu! ctrlp#init(type, ...)
let [s:matches, s:init] = [1, 1] let [s:matches, s:init] = [1, 1]
cal s:Open() cal s:Open()
cal s:SetWD(a:0 ? a:1 : '') cal s:SetWD(a:0 ? a:1 : '')
cal s:SetDefTxt()
cal s:MapKeys() cal s:MapKeys()
cal ctrlp#syntax() cal ctrlp#syntax()
cal ctrlp#setlines(s:settype(a:type)) cal ctrlp#setlines(s:settype(a:type))
cal s:SetDefTxt()
cal s:BuildPrompt(1) cal s:BuildPrompt(1)
endf endf
" - Autocmds {{{1 " - Autocmds {{{1