Skip to content

Commit

Permalink
Pass str directly when match_func is used
Browse files Browse the repository at this point in the history
  • Loading branch information
kien committed Apr 5, 2012
1 parent fec6cf5 commit dfd54e1
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions autoload/ctrlp.vim
Expand Up @@ -331,11 +331,11 @@ fu! s:MatchIt(items, pat, limit, exc)
retu lines
endf

fu! s:MatchedItems(items, str, pat, limit)
fu! s:MatchedItems(items, pat, limit)
let exc = exists('s:crfilerel') ? s:crfilerel : ''
let items = s:narrowable() ? s:matched + s:mdata[3] : a:items
if s:matcher != {} && has_key(s:matcher, 'match')
let argms = [items, a:str, a:limit, s:mmode(), s:ispath, exc, s:regexp]
if s:matcher != {}
let argms = [items, a:pat, a:limit, s:mmode(), s:ispath, exc, s:regexp]
let lines = call(s:matcher['match'], argms)
el
let lines = s:MatchIt(items, a:pat, a:limit, exc)
Expand Down Expand Up @@ -417,9 +417,9 @@ fu! s:Update(str)
let str = s:sanstail(a:str)
" Stop if the string's unchanged
if str == oldstr && !empty(str) && !exists('s:force') | retu | en
let pat = s:SplitPattern(str)
let pat = s:matcher == {} ? s:SplitPattern(str) : str
let lines = exists('g:ctrlp_nolimit') && empty(str) ? copy(g:ctrlp_lines)
\ : s:MatchedItems(g:ctrlp_lines, str, pat, s:winh)
\ : s:MatchedItems(g:ctrlp_lines, pat, s:winh)
cal s:Render(lines, pat)
endf

Expand Down Expand Up @@ -1018,7 +1018,6 @@ fu! s:mixedsort(s1, s2)
endf

fu! s:multipliers(...)
" Dynamic multipliers
let mp_1 = !a:1 ? 0 : 2
let mp_2 = !a:2 ? 0 : mp_1 + 1
let mp_3 = !a:3 ? 0 : ( !mp_2 ? mp_1 + 1 : mp_2 ) * 2
Expand Down Expand Up @@ -1051,7 +1050,7 @@ fu! ctrlp#statusline()
let byfname = s:byfname ? 'file' : 'path'
let marked = s:opmul != '0' ?
\ exists('s:marked') ? ' <'.s:dismrk().'>' : ' <->' : ''
if s:status != {} && has_key(s:status, 'main')
if s:status != {}
let args = [focus, byfname, s:regexp, prv, item, nxt, marked]
let &l:stl = call(s:status['main'], args)
el
Expand All @@ -1072,8 +1071,7 @@ endf

fu! ctrlp#progress(enum)
if has('macunix') || has('mac') | sl 1m | en
let &l:stl = s:status != {} && has_key(s:status, 'prog')
\ ? call(s:status['prog'], [a:enum])
let &l:stl = s:status != {} ? call(s:status['prog'], [a:enum])
\ : '%#CtrlPStats# '.a:enum.' %* %=%<%#CtrlPMode2# '.getcwd().' %*'
redraws
endf
Expand Down

0 comments on commit dfd54e1

Please sign in to comment.