main: make FocusLost autocommand configurable

references #1807
This commit is contained in:
Christian Brabandt 2018-10-15 14:23:45 +02:00
parent 68f5f1e50d
commit 07ac69570b
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 10 additions and 5 deletions

View File

@ -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*

View File

@ -106,7 +106,9 @@ function! s:airline_toggle()
autocmd TerminalOpen * call <sid>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()