ctrlp-funky
ctrlp-funky copied to clipboard
add sort_candidates_reverse feature
I want kind of this reverse-sorting feature in ctrlp-funky.
function 's:sort_candidates_reverse' is almost all the same as function 's:sort_candidates', I know it's not clean.
could you tell how i should fix this pull-req? or, could you revise and merge this into master?
thanks.
Simply, like this change is enough to do the job in this case, IMHO:
--- i/autoload/ctrlp/funky.vim
+++ w/autoload/ctrlp/funky.vim
@@ -300,6 +300,9 @@ function! ctrlp#funky#extract(bufnr, patterns)
endfor
let sorted = sort(candidates, function('s:sort_candidates'))
+ if s:sort_reverse
+ let sorted = reverse(sorted)
+ endif
let prior = map(sort(mru, function('s:sort_mru')), 'v:val[0]')
if s:use_cache && s:fu.is_real_file(a:bufnr)
I'm curious why do you want to have this feature.
ah, thanks for your advice

