[Buffers] Increase tabstop if the number of buffers >= 1000

Fix #1237
This commit is contained in:
Junegunn Choi
2021-02-02 11:11:20 +09:00
parent 68ab645574
commit 02a192ea0b

View File

@@ -730,10 +730,11 @@ function! fzf#vim#buffers(...)
\ [a:1, a:000[1:]] : ['', a:000]
let sorted = fzf#vim#_buflisted_sorted()
let header_lines = '--header-lines=' . (bufnr('') == get(sorted, 0, 0) ? 1 : 0)
let tabstop = len(sorted) >= 1000 ? 9 : 8
return s:fzf('buffers', {
\ 'source': map(sorted, 'fzf#vim#_format_buffer(v:val)'),
\ 'sink*': s:function('s:bufopen'),
\ 'options': ['+m', '-x', '--tiebreak=index', header_lines, '--ansi', '-d', '\t', '--with-nth', '3..', '-n', '2,1..2', '--prompt', 'Buf> ', '--query', query, '--preview-window', '+{2}-/2']
\ 'options': ['+m', '-x', '--tiebreak=index', header_lines, '--ansi', '-d', '\t', '--with-nth', '3..', '-n', '2,1..2', '--prompt', 'Buf> ', '--query', query, '--preview-window', '+{2}-/2', '--tabstop', tabstop]
\}, args)
endfunction