Closed serranomorante closed 5 months ago
Now I realized UILeave
also don't work when exiting neovim as :qa!
. What always work is just remembering to manually save the session before leaving. I also can't use the autosave
option from resession because it uses VimLeavePre
under the hook.
Looks like when Neovim is killed all of the buffers are marked as unloaded during VimLeavePre. I added a hack to work around this
Did you check the docs and existing issues?
Neovim version (nvim -v)
NVIM v0.10.0-dev-2064+g2f9ee9b6c
Operating system/version
arch, ubuntu
Describe the bug
Hi! All buffers from the session
.json
file are marked asloaded: false
when exiting neovim by closing the terminal window instead of executing:qa!
.Is my understanding that at least 1 of the buffers from that
.json
file should be marked asloaded: true
for everything to work correctly later on load, right? I believe that is the case because this is the root of a problem I'm having and which is kinda painful to fully replicate.What is the severity of this bug?
tolerable (can work around it)
Steps To Reproduce
Using the provided repro, open neovim nightly with
nvim --clean +'so repro.lua'
. Put at least 2 files (of any type) under the same cwd as your repro.nvim --clean +'so repro.lua'
:qa!
~...resession_issue/.repro/data/nvim/dirsession/_session_file.json
) and inspect the.json
file, at least 1 of the buffers is marked as loaded. This is good..json
file again. Now all buffers are marked as unloaded. Bad (I think)This doesn't seems to cause that much of a problem, until you have some complicated lazy-loading on your neovim config.
My workaround is using "UILeave" event instead of "VimLeavePre":
Expected Behavior
At least 1 buffer should be marked as loaded
Directory structure
. ├── file-1.md ├── file-2.md └── repro.lua
Repro
Did you check the bug with a clean config?
nvim -u repro.lua
using the repro.lua file above.