Fix <plug>(fzf-complete-buffer-line)

Reported by Roland Emmerich
This commit is contained in:
Junegunn Choi 2017-04-24 10:34:40 +09:00
parent 605d9da512
commit f3c3646c81
No known key found for this signature in database
GPG key ID: 254BC280FEF9C627
2 changed files with 5 additions and 5 deletions

View file

@ -219,7 +219,7 @@ function! s:warn(message)
return 0 return 0
endfunction endfunction
function! s:uniq(list) function! fzf#vim#_uniq(list)
let visited = {} let visited = {}
let ret = [] let ret = []
for l in a:list for l in a:list
@ -361,7 +361,7 @@ endfunction
" ------------------------------------------------------------------ " ------------------------------------------------------------------
function! fzf#vim#colors(...) function! fzf#vim#colors(...)
return s:fzf('colors', { return s:fzf('colors', {
\ 'source': s:uniq(map(split(globpath(&rtp, "colors/*.vim"), "\n"), \ 'source': fzf#vim#_uniq(map(split(globpath(&rtp, "colors/*.vim"), "\n"),
\ "substitute(fnamemodify(v:val, ':t'), '\\..\\{-}$', '', '')")), \ "substitute(fnamemodify(v:val, ':t'), '\\..\\{-}$', '', '')")),
\ 'sink': 'colo', \ 'sink': 'colo',
\ 'options': '+m --prompt="Colors> "' \ 'options': '+m --prompt="Colors> "'
@ -922,7 +922,7 @@ endfunction
function! fzf#vim#helptags(...) function! fzf#vim#helptags(...)
let sorted = sort(split(globpath(&runtimepath, '**/doc/tags'), '\n')) let sorted = sort(split(globpath(&runtimepath, '**/doc/tags'), '\n'))
let tags = exists('*uniq') ? uniq(sorted) : s:uniq(sorted) let tags = exists('*uniq') ? uniq(sorted) : fzf#vim#_uniq(sorted)
return s:fzf('helptags', { return s:fzf('helptags', {
\ 'source': "grep -H '.*' ".join(map(tags, 'shellescape(v:val)')). \ 'source': "grep -H '.*' ".join(map(tags, 'shellescape(v:val)')).

View file

@ -151,9 +151,9 @@ function! fzf#vim#complete#line(...)
endfunction endfunction
function! fzf#vim#complete#buffer_line(...) function! fzf#vim#complete#buffer_line(...)
call fzf#vim#complete(s:extend({ return fzf#vim#complete(s:extend({
\ 'prefix': '^.*$', \ 'prefix': '^.*$',
\ 'source': s:uniq(getline(1, '$'))}, get(a:000, 0, g:fzf#vim#default_layout))) \ 'source': fzf#vim#_uniq(getline(1, '$'))}, get(a:000, 0, g:fzf#vim#default_layout)))
endfunction endfunction
let &cpo = s:cpo_save let &cpo = s:cpo_save