-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Status line indicates wrong window as having focus #2551
Comments
do you have a quickfix plugin installed? |
@chrisbra No quickfix plugin installed |
hm, so wait, please clariy:
What have you set for |
The following screencast shows the same behavior in a different environment. Notice that the window focused by vim-airline is not the same window that contains the cursor. After moving the cursor to the right, vim-airline changes the highlighted window. In summary:
screencast-220817-1508-25.mp4 |
Okay, let's back up and try to reproduce with a minimum vimrc file: vim --clean -u <(cat <<EOF
set nocompatible
set bg=dark
set termguicolors
filetype plugin indent on
syntax enable
let &rtp = '~/.vim/pack/minpac/start/vim-airline,' . &rtp
EOF
) -c ":call setqflist([{'filename': expand('~/.vim/vimrc'), 'lnum': 1}])" -c ':copen' Now press enter in the quickfix window. Does this update the statusline? |
if it does, there is something wrong with your configuration (possibly a plugin), if it does not, there is something wrong with vim. You may need to debug the |
I don't think I ever said anything about pressing enter in the quickfix window. As I said before, I'm simply pressing I was able to replicate the same behavior using your configuration. As you can see, it is a bit inconsistent (the second screencast-220817-1948-20.mp4For the record, the default status line (or even lightline.vim) doesn't show the same behavior, so I don't think there is anything wrong with vim. |
ah I forgot, when typing |
oh and can you possibly try the following patch please? diff --git a/plugin/airline.vim b/plugin/airline.vim
index e2d0d28..7b311e6 100644
--- a/plugin/airline.vim
+++ b/plugin/airline.vim
@@ -62,13 +62,13 @@ function! s:on_window_changed(event)
" 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]
- if get(g:, 'airline_last_window_changed', []) == l:key
- \ && &stl is# '%!airline#statusline('.s:active_winnr.')'
- \ && &ft !~? 'gitcommit'
- " fugitive is special, it changes names and filetypes several times,
- " make sure the caching does not get into its way
- return
- endif
+" if get(g:, 'airline_last_window_changed', []) == l:key
+" \ && &stl is# '%!airline#statusline('.s:active_winnr.')'
+" \ && &ft !~? 'gitcommit'
+" " fugitive is special, it changes names and filetypes several times,
+" " make sure the caching does not get into its way
+" return
+" endif
let g:airline_last_window_changed = l:key
call s:init()
call airline#update_statusline() |
Sure, here you can see the log file: http://ix.io/47Ve Are you sure that's the right patch? I can't see any difference. |
thanks, so the WinEnter autocommand is executed. Did you run
Well debugging here and my guess was that that check skips the update. So apparently this wasn't the case. I still don't not sure, why it wouldn't update the statusline. |
That's correct. I believe the first try didn't replicate the issue, so I ran
The thing is that I applied the patch, but that didn't fix the issue. However, I can't see which lines are changing with respect to the previous version, which is why I asked if this is the right patch. |
sorry, I did not follow. Did you apply the patch or not? And did it work or not? |
Yes, I applied the patch and it didn't work. |
environment
let g:airline_extensions = []
let g:airline_section_y = 'B:%{bufnr("%")}'
if you are using terminal:
if you are using Neovim:
actual behavior
Status line stays active in the quickfix window after running :make, even though the cursor is in the other window:
Pressing a key shows the status line in the right window:
expected behavior
The status line should indicate the window with the cursor after running :make
It is not clear if this bug is the same as #1914. The suggested fix there didn't work in this issue.
The text was updated successfully, but these errors were encountered: