Skip to content

Commit 35fac96

Browse files
committed
Merge pull request #226 from okcompute/master
Fix most recent used buffer list sorting when using CtrlpBuffers after loading a Vim session.
2 parents fb87877 + 12a5367 commit 35fac96

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

autoload/ctrlp.vim

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,16 @@ endf
13711371
fu! s:compmreb(...)
13721372
" By last entered time (bufnr)
13731373
let [id1, id2] = [index(s:mrbs, a:1), index(s:mrbs, a:2)]
1374-
retu id1 == id2 ? 0 : id1 > id2 ? 1 : -1
1374+
if id1 == id2
1375+
return 0
1376+
endif
1377+
if id1 < 0
1378+
return 1
1379+
endif
1380+
if id2 < 0
1381+
return -1
1382+
endif
1383+
return id1 > id2 ? 1 : -1
13751384
endf
13761385

13771386
fu! s:compmref(...)

0 commit comments

Comments
 (0)