Shade.nvim
Shade.nvim copied to clipboard
Error when using sessions
getting this message pack/packer/start/Shade.nvim/lua/shade.lua:278: Invalid window id: 1004
I think it is related with this https://github.com/lewis6991/gitsigns.nvim/issues/161
I've done quite a bit of refactoring before I tested sessions, and didn't seem to have any issues. This is after having implemented support for tabpages though, which may have inadvertently fixed it.
Let me know if you're still seeing the problem.
yes, still happening.
What do you have sessionoptions set to?
I believe if you remove blank from sessionoptions it fixes the problem.
I can't immediately think of another way to exclude the plugins windows being saved to the session file.
So I also encounter this issue specifically with sessions. As far as I can see it works well if I don't load a session. My sessionopts are globals,buffers,curdir,tabpages,help,winpos, I don't use blank and still hit this issue
I tried removing winpos and tabpages but still no dice
The settings I'm using are sessionoptions = "buffers,curdir,folds,tabpages,winsize".
I used your settings without issue, it's only introducing blank that makes the problem appear for me:
https://streamable.com/cdahjh
I'm not sure what else could influence it. Are there enew's in your Session.vim? (I assume the same amount as you have open windows/splits)
There's also a debug=true config flag which gives some insight into what's happening.
It's not very usable as it is, because it floods the message area and demands 'press return to continue', but the output of the session load might be helpful.
@sunjon I just deleted my session file and started afresh and I'm no longer seeing the window errors. I had a look at the file first and there were no enew calls. I then started a new tab and closed nvim and restarted it and this created empty no name buffers (I've been trying to fix that particular issue for a while since I hate that. Not sure if it relates to how tabs are restored).
This causes the issue to come back btw so any [no name] buffers seem to trigger the bug

Here's a quick screen grab with debug = true
Just doing some debug if I remove silent only from session file no more errors and all works well.
I can confirm that removing silent only from the session file seems to fix the issue for me. However, I use startify for session management, and its convenience functions seem to add those lines automatically. I haven't debugged when or why that happens, but the side effect is I can't use shade with startify sessions :(
This happens to me after restoring a session and opening the neo-tree buffer. It throws errors with virtual text all around and breaks neovim, I have no choice but to close it. My sessionoptions only contain buffers.
Hey folks, I have a fork here with a patch for this. https://github.com/0x100101/Shade.nvim
I'll probably make a PR at some point, but in the meantime if anyone wants to try it out, please do and let me know if it solves your issues.