Skip to content

Commit d93d978

Browse files
authored
Merge pull request #543 from prabirshrestha/events
add async api support
2 parents 585143a + e99893b commit d93d978

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

autoload/ctrlp.vim

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,9 @@ fu! s:BuildPrompt(upd)
790790
if empty(prt[1]) && s:focus
791791
exe 'echoh' hibase '| echon "_" | echoh None'
792792
en
793+
if a:upd
794+
cal s:NotifySearch()
795+
en
793796
endf
794797
" - SetDefTxt() {{{1
795798
fu! s:SetDefTxt()
@@ -2609,6 +2612,10 @@ fu! ctrlp#clearmarkedlist()
26092612
let s:marked = {}
26102613
endf
26112614

2615+
fu! ctrlp#input()
2616+
retu s:getinput()
2617+
endf
2618+
26122619
fu! ctrlp#exit()
26132620
cal s:PrtExit()
26142621
endf
@@ -2735,8 +2742,21 @@ fu! ctrlp#init(type, ...)
27352742
en
27362743
cal s:BuildPrompt(1)
27372744
if s:keyloop | cal s:KeyLoop() | en
2738-
return 1
2745+
retu 1
2746+
endf
2747+
2748+
" - Events {{{1
2749+
fu! s:NotifySearch()
2750+
let l:cb = s:getextvar('search')
2751+
if l:cb != -1
2752+
cal eval(l:cb)
2753+
en
27392754
endf
2755+
2756+
fu! ctrlp#update()
2757+
cal s:ForceUpdate()
2758+
endf
2759+
27402760
" - Autocmds {{{1
27412761
if has('autocmd')
27422762
aug CtrlPAug

0 commit comments

Comments
 (0)