mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-25 09:41:33 +08:00
main: ignore popup windows for inactive windows
When openning popup (vim) or floating (neovim) windows, do not consider those windows for disabled windows. That is, leave the main window in activate state instead of marking it disabled closes: #2387
This commit is contained in:
parent
de73a21903
commit
8e36c0a8ed
|
@ -142,9 +142,10 @@ endfunction
|
|||
|
||||
" Update the statusline
|
||||
function! airline#update_statusline()
|
||||
if airline#util#stl_disabled(winnr())
|
||||
if airline#util#stl_disabled(winnr()) || airline#util#is_popup_window(winnr())
|
||||
return
|
||||
endif
|
||||
" TODO: need to ignore popup windows here as well?
|
||||
let range = filter(range(1, winnr('$')), 'v:val != winnr()')
|
||||
" create inactive statusline
|
||||
call airline#update_statusline_inactive(range)
|
||||
|
|
|
@ -204,6 +204,15 @@ function! airline#util#ignore_next_focusgain()
|
|||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#util#is_popup_window(winnr)
|
||||
" Keep the statusline active if it's a popup window
|
||||
if exists('*win_gettype')
|
||||
return win_gettype(a:winnr) ==# 'popup' || win_gettype(a:winnr) ==# 'autocmd'
|
||||
else
|
||||
return getwinvar(a:winnr, '&buftype', '') ==# 'popup'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#util#try_focusgained()
|
||||
" Ignore lasts for at most one second and is cleared on the first
|
||||
" focusgained. We use ignore to prevent system() calls from triggering
|
||||
|
|
Loading…
Reference in New Issue
Block a user