Permalink
Browse files

Improve unite sources

  • Loading branch information...
1 parent f6394ba commit 90abb7e9f19dcdfe3efc46389de69b7f703fa7bf @Shougo committed Feb 23, 2014
@@ -54,7 +54,7 @@ function! s:source.get_complete_position(context) "{{{
endfunction "}}}
function! s:source.gather_candidates(context) "{{{
- return filter(vimshell#util#uniq(reverse(vimshell#history#read())),
+ return filter(reverse(vimshell#history#read()),
\ 'stridx(v:val, a:context.complete_str) >= 0')
endfunction "}}}
@@ -69,6 +69,8 @@ function! s:source.hooks.on_syntax(args, context) "{{{
endtry
endfunction"}}}
function! s:source.hooks.on_post_filter(args, context) "{{{
+ let a:context.candidates = vimshell#util#uniq(a:context.candidates)
+
let cnt = 0
for candidate in a:context.candidates
@@ -85,11 +87,13 @@ function! s:source.hooks.on_post_filter(args, context) "{{{
let cnt += 1
endfor
+
+ return a:context.candidates
endfunction"}}}
function! s:source.gather_candidates(args, context) "{{{
- return map(vimshell#util#uniq(reverse(
- \ a:context.source__current_histories)), '{ "word" : v:val }')
+ return map(reverse(a:context.source__current_histories),
+ \ '{ "word" : v:val }')
endfunction "}}}
" vim: foldmethod=marker

0 comments on commit 90abb7e

Please sign in to comment.