From 19c655b420271f36263c35009980c737a99cd722 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Mon, 25 Nov 2019 16:24:58 +0100 Subject: [PATCH] plugin: do not trigger redraws for popup windows coc.nvim might set the filetype of the poppup window, which might trigger a redraw of the statusline, causing the current window to become inactive. So bail out early, if the current buffer is a popup buffer. It cannot have a statusline anyhow. fixes #1930 (but this time for Vim) --- plugin/airline.vim | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugin/airline.vim b/plugin/airline.vim index 84bf3480..13e6bbda 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -46,16 +46,16 @@ endfunction let s:active_winnr = -1 function! s:on_window_changed(event) - let s:active_winnr = winnr() - - if pumvisible() && (!&previewwindow || g:airline_exclude_preview) + " don't trigger for Vim popup windows + if &buftype is# 'popup' return endif - " work around a neovim bug: do not trigger on floating windows - " Disabled, Bug is fixed in Neovim, TODO: should be removed soon - " if exists("*nvim_win_get_config") && !empty(nvim_win_get_config(0).relative) - " return - " endif + + if pumvisible() && (!&previewwindow || g:airline_exclude_preview) + " do not trigger for previewwindows + return + endif + let s:active_winnr = winnr() " Handle each window only once, since we might come here several times for " different autocommands. let l:key = [bufnr('%'), s:active_winnr, winnr('$'), tabpagenr(), &ft]