Closed catdadcode closed 9 months ago
Oh and I did clear the sessions directory regularly while verifying this bug (~/.local/state/nvim/sessions
). Forgot to mention that.
I'm pretty sure that's because project.nvim changes your current directory. persistence saves sessions based on the cwd. You can disable that option in projects.nvim I believe
Oh that makes sense. Thank you. I'll go see about disabling that option and try again π
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.10.0-dev-1325+gc4f8be464-Homebrew (true for stable nvim as well)
Operating system/version
Windows 11 Pro (build 22621.2428, 22H2)
Describe the bug
For some reason this is most prevalent from within my
~/.dotfiles
repository, but it happens in other project directories as well. Persistence would often load old sessions and they would seem to get "stuck", meaning the same session would always load no matter how I modified things after restoring it. If I quit Neovim, re-open, and restore the session it would restore a session from further back. This same session would keep loading for every restore no matter how it got modified, but every once in a while it would somehow miraculously save a new session that would then also get stuck.I am relatively new to Vim/Neovim within the last 6 months and I lack the skills to track this down easily so I just lived with it for a while since it seemed to work like 60-70% of the time in most of my projects. Then I redid my config switching over to use the
:LazyExtras
instead of hardcoding the extra specs. I forgot to re-include theutil.project
extra. I noticed right away that my sessions were working flawlessly. I figured some bug had been fixed and shrugged. Then I realized a bit ago that I forgot the project extra and enabled it. Immediately reproduced the session issue.Sure enough I can reproduce it consistently by enabling/disabling the project extra. Project extra was not so special that I couldn't live without it so I've just removed it for now, but figured I ought to let ya know π.
PS - I made an educated guess about which project I should log this issue with and chose the one experiencing the issues first. Do let me know if I should instead open this issue over at ahmedkhalf/project.nvim.
Steps To Reproduce
util.project
extra.Do this a few times and you should hopefully reproduce the intermittent session saving behavior.
Expected Behavior
I expected persistence.nvim and project.nvim to operate as expected regardless of the presence of the other.
Repro