mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-05-16 13:35:00 +08:00
tabline: Cache title as tablocal variable
This commit is contained in:
@@ -146,11 +146,14 @@ function! airline#extensions#tabline#title(n)
|
||||
let buflist = tabpagebuflist(a:n)
|
||||
let winnr = tabpagewinnr(a:n)
|
||||
let all_buffers = airline#extensions#tabline#buflist#list()
|
||||
return airline#extensions#tabline#get_buffer_name(
|
||||
let title = airline#extensions#tabline#get_buffer_name(
|
||||
\ buflist[winnr - 1],
|
||||
\ filter(buflist, 'index(all_buffers, v:val) != -1'))
|
||||
endif
|
||||
|
||||
if exists("*settabvar") && !empty(title)
|
||||
call settabvar(a:n, 'title', title)
|
||||
endif
|
||||
return title
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user