Skip to content

Commit

Permalink
Fix Unknown function: uniq (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
tacahiroy committed Oct 7, 2015
1 parent 540afd3 commit df6dc6c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion autoload/ctrlp/funky.vim
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ endfunction
function! s:str2def(line)
return matchstr(a:line, '^.*\ze\t#')
endfunction

function! s:uniq(list)
return exists('*uniq') ? uniq(a:list) : a:list
endfunction
" }}}

" Provides a list of strings to search in
Expand Down Expand Up @@ -334,7 +338,7 @@ function! ctrlp#funky#extract(bufnr, patterns)

let sorted = sort(candidates, function('s:sort_candidates'))
let prior = map(sort(mru, function('s:sort_mru')), 'v:val[0]')
let results = uniq(prior + sorted)
let results = s:uniq(prior + sorted)

if s:use_cache && s:fu.is_real_file(a:bufnr)
call s:cache.save(a:bufnr, results)
Expand Down Expand Up @@ -445,6 +449,7 @@ call s:fu.debug('INFO: mutli_buffers? ' . (s:is_multi_buffers ? 'TRUE' : 'FALSE'
" | | `- match first tab delimited str
" | `- match full line like file/dir path
" `- match full line
let g:ctrlp_ext_vars = get(g:, 'ctrlp_ext_vars', [])
call add(g:ctrlp_ext_vars, {
\ 'init': 'ctrlp#funky#init(s:crbufnr)',
\ 'accept': 'ctrlp#funky#accept',
Expand All @@ -457,6 +462,7 @@ call add(g:ctrlp_ext_vars, {
\ })

" Give the extension an ID
let g:ctrlp_builtins = get(g:, 'ctrlp_builtins', 0)
let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)

let &cpo = s:save_cpo
Expand Down

0 comments on commit df6dc6c

Please sign in to comment.