Closed l3d00m closed 1 month ago
Thank you for raising. Unfortunately I have no access to a Windows machine so will tag this as help wanted from the community.
Makes sense. Is there a way to extract any logs from persisted.nvim or make it more verbose? I'd like to debug it myself, but found it hard w/o any error messages present.
That's a good shout. I'll add some logging tonight
If you update the plugin and change log_level = "TRACE"
that will start logging to persisted.log. The location on Mac is /Users/Oli/.local/state/nvim/persisted.log
but unsure on Windows 😓 .
I may not have gone far enough with the logging so feel free to add your own. You can see from 4df3f8a that it's straightforward to do so.
Thanks a lot! Unfortunately I can only try this at work next Monday (since at home I don't have windows either). But this will definitely be helpful since I can also easily add my own logging statements based on this if required.
I could now pin it down to the usage of 2>/dev/null
when running git. On windows this fails with a Path not found. This happens e.g. here: https://github.com/olimorris/persisted.nvim/blob/4df3f8a03690add1bc2f9a79b31e1c43f5e0dd05/lua/persisted/init.lua#L132
If I remove all 2>/dev/null
arguments from this file (found it in 4 spots), this now works successfully under windows as well.
Maybe that already helps?
I recall this is needed on unix based systems to discard any errors that arise from running the tool. Can we use a conditional to run a separate command for windows?
Hey @l3d00m any update on this?
Sorry for never coming back to you, I had a busy time. But thanks to https://github.com/olimorris/persisted.nvim/commit/0446fd02171aeb428090d3fbb7956e849a66b9f5 it now also works on windows without problems!
Glad to hear it!
Your
minimal.lua
configError messages
No error messages present
Describe the bug
With the above
repro.lua
nvim doesn't detect the git branch and stores all sessions only per folder, not per folder+branch. Even thouse_git_branch = true
is setThis is also visible in my neovim-data/sessions directory, where there is only one session called something like
C%%Users%myuser%IdeaProjects%test.vim
(no other files, and no file containing the branch name)This is on Windows! (i know, would prefer linux too). I couldn't really debug it myself since there were no error messages, is there a way to make persisted.nvim more verbose?
Reproduce the bug
repro.lua
withnvim --clean -u .\repro.lua
in a git repository and opening some files,:SessionSave
Final checks
minimal.lua
config file above and still get the issueSessionSave
to save the session before restarting Neovim and usingSessionLoad