context.vim
context.vim copied to clipboard
Can't close last window in tab
When I hit ZQ or :q I get error:
E5601: Cannot close window, only floating window would remain
Expected is to normally close the window.
Thank you. I haven't run into this yet. Can you tell me what Vim/Neovim version you are using?
And can you give more detailed instructions so I can try to reproduce the issue?
:version
NVIM v0.4.3
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: /usr/bin/gcc-5 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wvla -fstack-protect
or-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/home/travis/build/neovim/bot-ci/build/neovim/build/config -I/home/travis/build/neovim/bot-ci/build/ne
ovim/src -I/home/travis/build/neovim/bot-ci/build/neovim/.deps/usr/include -I/usr/include -I/home/travis/build/neovim/bot-ci/build/neovim/build/src/nvim/auto -I/home/travis/build/neovim/bot-ci/build/neovim/build/include
Compiled by travis@travis-job-9a287301-34f2-4b86-92e3-462594f51f36
Features: +acl +iconv +tui
What I've did is just open file long enough, that context floating window is displayed and try to close a window.
Hmm, I'm using the same Neovim version.
Can you reproduce this with different files of different filetypes? I wonder if there might be something specific about your file.
Could you try reproducing this with all other plugins temporarily disabled? I wonder if there might be some interaction between different plugins.
Thanks!
This looks like it is not triggered always. I am not sure how I've ended up with such state. I am not able to reproduce this with freshly started neovim instance. I have one opened and it won't close if context window is visible. Is there a way I could track the issue on this single opened neovim instance?
What's the state of that instance? Single tab with one window which has a context popup?
If you scroll the window, does the context popup update accordingly?
Several tabs opened. Scroll works fine, context is updated correctly. I am able to close the window once I scroll to top (and context window is not displayed anymore).
Ah, I can reproduce now. You need to have at least two tabs open. Then in one tab have only one window open and it's context popup visible. :q will then lead to this issue.
I will check if there's anything I can do about this. But I don't have a lot of time on my hands right now, so might take a while.
In the meantime you could use :tabc.
Good catch. I didn't think that multiple tabs might be the case. It's unclear to me why same situation with only one tab is not causing the problem.
Btw, there's even a TODO in code to consider just closing the popup instead of failing. We might open a Neovim issue about this. I just tested in Vim8 and it doesn't complain about this case either, it just closes the float. https://github.com/neovim/neovim/blob/d22fd58629c6aa93d808d74a7e6dee79e3246ae0/src/nvim/window.c#L2476-L2477
Looks like its already open: https://github.com/neovim/neovim/issues/11440