-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cwd session can get overwritten #72
Comments
Another situation that can occur: Repro:
Actual: Buffers are as per step 8. There is a variant of this, where autoload cwd is not enabled, but a user manually loads a session, then closes it. How the I've also logged #73 which is probably the first thing to address. |
While looking at the code thinking how I might solve this, the following occurred to me:
autosave = {
cwd = function()
local s = require("possession.session")
local p = require("possession.paths")
return not s.exists(p.cwd_session_name())
end,
} This looks to satisfy my needs as outlined in this issue. * (continued from above). I'm unsure if setting the current session value during autoload is something you expected to happen. It gets set in |
Thanks, it's probably worth adding a note in the readme. |
This is essentially a variant of #67.
I have
autoload
set tocwd
,autosave.cwd = true
, andautosave.on_quit = true
. This works great for the typical use case for me: I load nvim, open some buffers, quit, come back, and the session is restored for that cwd.We implemented the feature that when a file is passed to nvim, it prevents autoload. This is good, but autosave then saves this single file on quit, overwriting my cwd autosave session. While #67 was more an issue due to dev bugs, this is a real world issue and really annoying.
Probably want to have more of a think how to handle this. I'm sure it's going to affect others.
Repro:
Actual: the file argument file is restored as the autoloaded session.
Expected: the original buffers from step 3.
I would expect that if autoload is disabled, then autosave is also disabled (with caveats, see below).
Some quick notes on things to consider:
User might not have not autoload enabled
User might opt in to a session, so autosave might need to be enabled at some point even if it was disabled due to a file arg being passed to nvim.
The text was updated successfully, but these errors were encountered: