From 1d486430cc340a9210025c478acee656e236cde0 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Wed, 23 Mar 2022 19:40:21 +0100 Subject: [PATCH] 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 --- autoload/airline/util.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/airline/util.vim b/autoload/airline/util.vim index 93851fb0..bb0a1d2b 100644 --- a/autoload/airline/util.vim +++ b/autoload/airline/util.vim @@ -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)