mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 12:50:04 +08:00
fix(tabline): fix tabline fold
close https://github.com/SpaceVim/SpaceVim/issues/4550
This commit is contained in:
parent
176261652e
commit
8e4183185c
@ -94,18 +94,29 @@ function! s:wrap_id(id) abort
|
|||||||
return id . ' '
|
return id . ' '
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" build the tab item, the first argv is bufnr, and the second argv is tabnr
|
||||||
function! s:buffer_item(bufnr, ...) abort
|
function! s:buffer_item(bufnr, ...) abort
|
||||||
let name = s:tabname(a:bufnr)
|
let name = s:tabname(a:bufnr)
|
||||||
|
let tabnr = get(a:000, 0, -1)
|
||||||
|
if tabnr != -1
|
||||||
|
let tabname = gettabvar(tabnr, '_spacevim_tab_name', '')
|
||||||
|
let len = strlen(tabname) + 3
|
||||||
|
else
|
||||||
|
let tabname = ''
|
||||||
|
let len = strlen(name) + 3
|
||||||
|
endif
|
||||||
let item = {
|
let item = {
|
||||||
\ 'bufnr' : a:bufnr,
|
\ 'bufnr' : a:bufnr,
|
||||||
\ 'len' : strlen(name) + 3,
|
\ 'len' : len,
|
||||||
\ 'bufname' : name,
|
\ 'bufname' : name,
|
||||||
\ 'tabnr' : get(a:000, 0, -1),
|
\ 'tabname' : tabname,
|
||||||
|
\ 'tabnr' : tabnr,
|
||||||
\ }
|
\ }
|
||||||
return item
|
return item
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" check if the items len longer than &columns
|
" check if the items len longer than &columns
|
||||||
|
" the check_len function should also check the tab name.
|
||||||
function! s:check_len(items) abort
|
function! s:check_len(items) abort
|
||||||
let len = 0
|
let len = 0
|
||||||
for item in a:items
|
for item in a:items
|
||||||
|
Loading…
Reference in New Issue
Block a user