From 07ac69570b0682e4652821c9b2fcfb6a10b517a5 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Mon, 15 Oct 2018 14:23:45 +0200 Subject: [PATCH] main: make FocusLost autocommand configurable references #1807 --- doc/airline.txt | 11 +++++++---- plugin/airline.vim | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/airline.txt b/doc/airline.txt index 642b794f..52f1a584 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -183,13 +183,13 @@ values): \ 'no' : 'N', \ 'R' : 'R', \ 'Rv' : 'R', - \ 'v' : 'V', - \ 'V' : 'V', - \ '' : 'V', \ 's' : 'S', \ 'S' : 'S', \ '' : 'S', \ 't' : 'T', + \ 'v' : 'V', + \ 'V' : 'V', + \ '' : 'V', \ } < * define the set of filename match queries which excludes a window from having @@ -206,7 +206,7 @@ values): let g:airline_exclude_preview = 0 < * disable the Airline customization for selective windows (this is a - window-local variable so you can disable it for only some windows) > + window-local variable so you can disable it per-window) > let w:airline_disabled = 1 * Do not draw separators for empty sections (only for the active window) > @@ -220,6 +220,9 @@ values): Set this to one, if you experience a sluggish Vim: > let g:airline_highlighting_cache = 0 < +* disable airline on FocusLost autocommand (e.g. when Vim loses focus): > + let g:airline_focuslost_inactive = 1 +< ============================================================================== COMMANDS *airline-commands* diff --git a/plugin/airline.vim b/plugin/airline.vim index 386cf7b5..d9307b91 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -106,7 +106,9 @@ function! s:airline_toggle() autocmd TerminalOpen * call on_colorscheme_changed() endif " Set all statuslines to inactive - autocmd FocusLost * call airline#update_statusline_inactive(range(1, winnr('$'))) + autocmd FocusLost * if get(g:, 'airline_focuslost_inactive', 0)| + \ call airline#update_statusline_inactive(range(1, winnr('$')))| + \ endif " Refresh airline for :syntax off autocmd SourcePre */syntax/syntax.vim \ call airline#extensions#tabline#buffers#invalidate()