mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-02-25 19:17:13 +08:00
better disabled highlighting for inactive windows on FocusLost
This will make sure that the current window will be highlighted as expected, even if there are no other windows and all highlighting groups will be correctly re-created as 'inactive' references #1807
This commit is contained in:
@@ -115,6 +115,14 @@ function! airline#update_statusline()
|
||||
call s:invoke_funcrefs(context, g:airline_statusline_funcrefs)
|
||||
endfunction
|
||||
|
||||
function! airline#update_statusline_focuslost()
|
||||
if get(g:, 'airline_focuslost_inactive', 0)
|
||||
let bufnr=bufnr('%')
|
||||
call airline#highlighter#highlight_modified_inactive(bufnr)
|
||||
call airline#highlighter#highlight(['inactive'], bufnr)
|
||||
call airline#update_statusline_inactive(range(1, winnr('$')))
|
||||
endif
|
||||
endfunction
|
||||
function! airline#update_statusline_inactive(range)
|
||||
if airline#util#getwinvar(winnr(), 'airline_disabled', 0)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user