From f9ada48b5826ff8406299dc1607d49dd926d3c77 Mon Sep 17 00:00:00 2001 From: mattn Date: Thu, 22 Nov 2012 17:58:14 +0900 Subject: [PATCH] Allow x_func options to be defined using dict functions Closes #319 --- autoload/ctrlp.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim index 72f2d6b..f101952 100644 --- a/autoload/ctrlp.vim +++ b/autoload/ctrlp.vim @@ -432,7 +432,7 @@ fu! s:MatchedItems(items, pat, limit) let items = s:narrowable() ? s:matched + s:mdata[3] : a:items if s:matcher != {} let argms = [items, a:pat, a:limit, s:mmode(), s:ispath, exc, s:regexp] - let lines = call(s:matcher['match'], argms) + let lines = call(s:matcher['match'], argms, s:matcher) el let lines = s:MatchIt(items, a:pat, a:limit, exc) en @@ -1140,7 +1140,7 @@ fu! s:OpenNoMarks(md, line) cal s:remarksigns() cal s:BuildPrompt(0) elsei a:md == 'x' - cal call(s:openfunc[s:ctype], [a:md, a:line]) + cal call(s:openfunc[s:ctype], [a:md, a:line], s:openfunc) elsei a:md == 'd' let dir = fnamemodify(a:line, ':h') if isdirectory(dir) @@ -1276,7 +1276,7 @@ fu! ctrlp#statusline() \ exists('s:marked') ? ' <'.s:dismrk().'>' : ' <->' : '' if s:status != {} let args = [focus, byfname, s:regexp, prv, s:ctype, nxt, marked] - let &l:stl = call(s:status['main'], args) + let &l:stl = call(s:status['main'], args, s:status) el let item = '%#CtrlPMode1# '.s:ctype.' %*' let focus = '%#CtrlPMode2# '.focus.' %*' @@ -1296,7 +1296,7 @@ endf fu! ctrlp#progress(enum, ...) if has('macunix') || has('mac') | sl 1m | en let txt = a:0 ? '(press ctrl-c to abort)' : '' - let &l:stl = s:status != {} ? call(s:status['prog'], [a:enum]) + let &l:stl = s:status != {} ? call(s:status['prog'], [a:enum], s:status) \ : '%#CtrlPStats# '.a:enum.' %* '.txt.'%=%<%#CtrlPMode2# %{getcwd()} %*' redraws endf @@ -1869,9 +1869,9 @@ endf fu! s:buffunc(e) if a:e && has_key(s:buffunc, 'enter') - cal call(s:buffunc['enter'], []) + cal call(s:buffunc['enter'], [], s:buffunc) elsei !a:e && has_key(s:buffunc, 'exit') - cal call(s:buffunc['exit'], []) + cal call(s:buffunc['exit'], [], s:buffunc) en endf