Skip to content

Commit 194987f

Browse files
committed
Fix last entered sorting
1 parent 6863e65 commit 194987f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

autoload/ctrlp.vim

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ fu! s:Close()
206206
exe s:winres[0]
207207
en
208208
unl! s:focus s:hisidx s:hstgot s:marked s:statypes s:cline s:init s:savestr
209-
\ g:ctrlp_nolimit
209+
\ s:mrbs g:ctrlp_nolimit
210210
cal ctrlp#recordhist()
211211
cal s:execextvar('exit')
212212
cal s:log(0)
@@ -867,7 +867,7 @@ fu! s:MarkToOpen()
867867
" Unmark and remove the file from s:marked
868868
let key = s:dictindex(s:marked, filpath)
869869
cal remove(s:marked, key)
870-
if empty(s:marked) | unl! s:marked | en
870+
if empty(s:marked) | unl s:marked | en
871871
if has('signs')
872872
exe 'sign unplace' key 'buffer='.s:bufnr
873873
en
@@ -957,8 +957,8 @@ fu! s:compmre(...)
957957
if !exists('s:mrbs')
958958
let s:mrbs = ctrlp#mrufiles#bufs()
959959
en
960-
let cwd = s:dyncwd
961-
retu index(s:mrbs, cwd.s:lash().a:1) - index(s:mrbs, cwd.s:lash().a:2)
960+
let [b1, b2] = [fnamemodify(a:1, ':p'), fnamemodify(a:2, ':p')]
961+
retu index(s:mrbs, b1) - index(s:mrbs, b2)
962962
endf
963963

964964
fu! s:comparent(s1, s2)
@@ -1010,7 +1010,6 @@ fu! s:mixedsort(s1, s2)
10101010
let ctm = s:comptime(a:s1, a:s2)
10111011
let [mp_1, mp_2, mp_3, mp_4] = s:multipliers(ctm, cfn, par, cml)
10121012
en
1013-
unl! s:mrbs
10141013
retu cln + ctm * mp_1 + cfn * mp_2 + par * mp_3 + cml * mp_4
10151014
en
10161015
let [mp_1, mp_2, mp_3, mp_4] = s:multipliers(cfn, par, cml, 0)

0 commit comments

Comments
 (0)