[Buffers] Increase tabstop according to the string length of bufno

e.g. vim {1..1000} +'silent 1bd'

Fix #1237
This commit is contained in:
Junegunn Choi
2021-03-25 01:15:29 +09:00
parent 1ef72b14cc
commit caf7754b26

View File

@@ -730,7 +730,7 @@ 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
let tabstop = len(max(sorted)) >= 4 ? 9 : 8
return s:fzf('buffers', {
\ 'source': map(sorted, 'fzf#vim#_format_buffer(v:val)'),
\ 'sink*': s:function('s:bufopen'),