tabline: prevent flicker on Windows

calling settabvar() while evaluating the 'tabline' setting apparently
causes flicker on Windows. Fall back to using `:let t:var` to store the
content in the current tabpage.

This is not as good as using `settabvar()` since we cannot store the
title for other tabs, but at least it should prevent the flicker and at
the same time at least cache the title for the current tabpage.
This commit is contained in:
Christian Brabandt 2017-06-27 18:28:28 +02:00
parent 825aec9e4d
commit 313a6fcad2
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -147,7 +147,12 @@ function! airline#extensions#tabline#title(n)
endif
if exists("*settabvar") && !empty(title)
call settabvar(a:n, 'title', title)
" don't use settabvar, it causes a refresh,
" which in turn causes flicker on windows
"call settabvar(a:n, 'title', title)
if tabpagenr() == a:n
let t:title = title
endif
endif
return title
endfunction