neovim: support global statusline and do not truncate too early

With Neovims recent merge of a global statusline (e.g. a statusline that
is the same across all windows), make sure that truncation only happens,
by checking the complete terminal window width instead of using the Vim
window width (similar to when using g:airline_statusline_ontop).

related: #2517
This commit is contained in:
Christian Brabandt 2022-03-23 19:40:21 +01:00
parent e2498d72dc
commit 1d486430cc
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
1 changed files with 3 additions and 1 deletions

View File

@ -18,7 +18,9 @@ let s:focusgained_ignore_time = 0
" actually changed.
function! airline#util#winwidth(...) abort
let nr = get(a:000, 0, 0)
if get(g:, 'airline_statusline_ontop', 0)
" When statusline is on top, or using global statusline for Neovim
" always return the number of columns
if get(g:, 'airline_statusline_ontop', 0) || &laststatus > 2
return &columns
else
return winwidth(nr)