Merge pull request #139 from blueyed/fix-complete-line

Fix fzf#vim#complete#line with new bufname display
This commit is contained in:
Junegunn Choi
2016-04-29 10:28:24 +09:00
2 changed files with 4 additions and 3 deletions

View File

@@ -250,7 +250,7 @@ function! fzf#vim#_lines(all)
call extend(b == buf ? cur : rest, call extend(b == buf ? cur : rest,
\ filter( \ filter(
\ map(lines, \ map(lines,
\ '(!a:all && empty(v:val)) ? "" : printf(s:blue("%2d\t", "TabLine")."%s".s:yellow("\t%4d ", "LineNr")."\t%s\t", b, bufname, v:key + 1, v:val)'), \ '(!a:all && empty(v:val)) ? "" : printf(s:blue("%2d\t", "TabLine")."%s".s:yellow("\t%4d ", "LineNr")."\t%s", b, bufname, v:key + 1, v:val)'),
\ 'a:all || !empty(v:val)')) \ 'a:all || !empty(v:val)'))
endfor endfor
return extend(cur, rest) return extend(cur, rest)

View File

@@ -136,14 +136,15 @@ endfunction
" <plug>(fzf-complete-buffer-line) " <plug>(fzf-complete-buffer-line)
" ---------------------------------------------------------------------------- " ----------------------------------------------------------------------------
function! s:reduce_line(lines) function! s:reduce_line(lines)
return join(split(a:lines[0], '\t\zs')[2:], '') return join(split(a:lines[0], '\t\zs')[3:], '')
endfunction endfunction
function! fzf#vim#complete#line(...) function! fzf#vim#complete#line(...)
return fzf#vim#complete(s:extend({ return fzf#vim#complete(s:extend({
\ 'prefix': '^.*$', \ 'prefix': '^.*$',
\ 'source': fzf#vim#_lines(0), \ 'source': fzf#vim#_lines(0),
\ 'options': '--tiebreak=index --ansi --nth 3..', \ 'options': '--tiebreak=index --ansi --nth 4..',
\ 'reducer': s:function('s:reduce_line')}, get(a:000, 0, g:fzf#vim#default_layout))) \ 'reducer': s:function('s:reduce_line')}, get(a:000, 0, g:fzf#vim#default_layout)))
endfunction endfunction