Closed criuss closed 1 year ago
I'm facing the very same issue. Similar behavior happened once diffView was previously opened.
How do you load persistence? On the BufReadPre
event? If so then that's of course normal. Persistence will never have been loaded and as such will also never have saved the session.
How do you load persistence? On the
BufReadPre
event? If so then that's of course normal. Persistence will never have been loaded and as such will also never have saved the session.
If that matters I use it in scope of LazyVim default configuration, while pressing C in Alpha menu
In LazyVim, session saving also only starts when you start editing a file
It used to work for me, but something happened and it currently does not. Pleasee see the video attached link
edit: it also worth mentioning that the .zshrc
file that opens in the 'last session' obviously does not belong to the cwd
Seems to be caused by adding globals
to session options. I added that a while back to support pinned tabs in bufferline. Willl see what's causing that
Now I can't reproduce it anymore. Very weird. Can you manually delete the session and see if the problem vanishes?
Should I simply erase the contents of ~/.local/state/nvim/sessions
?
That, or just the file of the directory you were testing with
STR:
It's normal that .zshrc is back on step 4? Or did you remove the buffer in step 3?
I'd expect both of these changed buffers will be opened in the session, but .zshrc opens on session restore action
@skoch13 so you have the opposite problem of op?
You open two files, then quit, open, and restore only shows one file?
(saving files makes no difference for persistence)
persistence saves the session on VimLeavePre
, so it's possible that another autocmd errors and that persistence will never save
I think I have related issue, because I did not open .zshrc file at all in the last session, but it gets restored.
just tested it again (with the latest lazyvim version) ... i was able to reproduce it with an existing session file and using :wq
(quiting via <leader>qq
worked)
after deleting the session file i was not able to reproduce the error again
Lately I solely use the latter qq shortcut. I’ll wipe sessions once again as you suggest.
Thank you for taking a look into it.
Must have something todo with that globals
sessionopts. Maybe due to an issue with Neovim or some other extension. The fact that I also can no longer reproduce it, after wiping session, probably means it has been fixed in the meantime.
thank you for your time @folke i'll close the issue as it is not reproducible anymore
Did you check docs and existing issues?
Neovim version (nvim -v)
0.9
Operating system/version
linux
Describe the bug
When opening any file with dot prefix these files get restored every time although the buffer was removed before saving the session.
Steps To Reproduce
Expected Behavior
.env file should not be restored
Repro
No response