tabline: Cache title as tablocal variable
This commit is contained in:
parent
174b7e1962
commit
b2f301f73c
|
@ -146,11 +146,14 @@ function! airline#extensions#tabline#title(n)
|
||||||
let buflist = tabpagebuflist(a:n)
|
let buflist = tabpagebuflist(a:n)
|
||||||
let winnr = tabpagewinnr(a:n)
|
let winnr = tabpagewinnr(a:n)
|
||||||
let all_buffers = airline#extensions#tabline#buflist#list()
|
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],
|
\ buflist[winnr - 1],
|
||||||
\ filter(buflist, 'index(all_buffers, v:val) != -1'))
|
\ filter(buflist, 'index(all_buffers, v:val) != -1'))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if exists("*settabvar") && !empty(title)
|
||||||
|
call settabvar(a:n, 'title', title)
|
||||||
|
endif
|
||||||
return title
|
return title
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||||
" vim: et ts=2 sts=2 sw=2
|
" vim: et ts=2 sts=2 sw=2
|
||||||
|
|
||||||
|
" TODO: Try to cache winwidth(0) function
|
||||||
|
" e.g. store winwidth per window and access that, only update it, if the size
|
||||||
|
" actually changed.
|
||||||
scriptencoding utf-8
|
scriptencoding utf-8
|
||||||
|
|
||||||
call airline#init#bootstrap()
|
call airline#init#bootstrap()
|
||||||
|
|
Loading…
Reference in New Issue