mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-07 04:34:26 +08:00
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:
@@ -18,7 +18,9 @@ let s:focusgained_ignore_time = 0
|
|||||||
" actually changed.
|
" actually changed.
|
||||||
function! airline#util#winwidth(...) abort
|
function! airline#util#winwidth(...) abort
|
||||||
let nr = get(a:000, 0, 0)
|
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
|
return &columns
|
||||||
else
|
else
|
||||||
return winwidth(nr)
|
return winwidth(nr)
|
||||||
|
|||||||
Reference in New Issue
Block a user