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
Focus gets confused, ends up with no split focused #1131
Comments
possibly related to #1125 although nothing in this case is a preview, they're all regular file splits. |
what are those mappings please? |
The example steps that are now in the description are all pure (built-in) vim commands, no mappings needed. I will try to reproduce with a minimal vimrc/plugins to make sure nothing else is interfering. |
It seems that this is a conflict with vim-stay somehow; I can reproduce the issue with just vim-stay and airline loaded via pathogen, and no other vimrc. |
Yeah, I can't replicate this behaviour currently |
I've filed a twin bug with vim-stay, but I'm not really sure which plugin is the root cause. If there's anything else you need please let me know. |
I've encountered this bug without having vim-stay installed. List of possibly relevant plugins I do have installed:
|
Well if you can reliably reproduce, I would be interested how to do so |
@chrisbra I have been able to reproduce it in conjunction with vim-stay: the issue manifests itself whenever loading a session (or view session, in stay’s case) changes the buffer’s |
Restoring local options causes no end of hard to track side effects with modelines, other plug-ins and what not (see vim-airline/vim-airline#1131 for an example). Fixes #29.
hm, perhaps we need an OptionSet autocommand (if the Vim/Nvim supports it) to reset the statusline, if it is changed? |
That would cover all cases. For versions of Vim without |
Restoring a session using vim -S with 'sessionopts' including options, might overwrite the statusline function. fixes vim-airline#1131
I think you are right, using OptionSet might not be the best choice (and would prevent the user from setting the option itsself (althought it wouldn't work anyhow)), so let's go ahead and use the SessionLoadPost autocommand. That's what i did in #1140. |
@chrisbra the |
Using latest master (including #1140) of vim-airline does not fix the issue with master vim-stay. Switching to the pending 1.4 release of vim-stay does fix the issue, but I thought I'd mention it since my understanding was that the vim-airline fix was supposed to work regardless? |
@kopischke Yes, but shouldn't the default viewfile include the statusline setting from vim-airline? e.g. the created sessionfile should save the statusline setting (with the value from vim-airline) so on restore, it resets back the statusline setting from vim-airline? |
@chrisbra yes it does, but that seems to throw airline off somehow. I might be wrong in assuming that it is specifically the |
Hi Martin! On Do, 21 Apr 2016, Martin Kopischke wrote:
Yes, that would be appreciated! |
Restoring local options causes no end of hard to track side effects with modelines, other plug-ins and what not (see vim-airline/vim-airline#1131 for an example). Fixes #29.
Restoring local options causes no end of hard to track side effects with modelines, other plug-ins and what not (see vim-airline/vim-airline#1131 for an example). Fixes #29.
I think, I understand now why this happens. e.g. when you create your viewfile the buffer is in a different window than when you restore the view. That would break, since the statusline setting includes the window number. However, since #1140 has been merged, I can't reproduce this issue anymore. @eapache please test again |
I can definitely still reproduce using the steps outlined in my original comment, with vim 7.4.1707 (Homebrew Macvim), vim-airline at d36085a (includes #1140) and vim-stay at zhimsel/vim-stay@89e5a31 (does not include zhimsel/vim-stay@6742c38). |
should fix vim-airline#1131 completely
okay, I think I found the problem. Going to create a PR in a second |
should fix vim-airline#1131 completely, but literally comparing the statusline option with the expected value
should fix vim-airline#1131 completely, but literally comparing the statusline option with the expected value
environment
I discovered this via Tim Pope's
fugitive
originally, but it turns out that's just a convenient way to run the correct sequence of buffer commands to confuse airline. In a fresh vim (no need for fugitive)::e file1
:split
:e file2
<leader>wj
(switch to the bottom split):e file2
<leader>wk
(switch back up):bd
Now the airline status bar is dimmed out (unfocused) incorrectly, even though there is no other split present which could possibly take focus.
The text was updated successfully, but these errors were encountered: