You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If configured with autosave.cwd = true and autoload.cwd = true, when starting Neovim M.load in session.lua will try to autosave. It looks like this should be skipped but for whatever reason, autosave_skip() is returning true for me.
This has the follow behaviour:
The cwd json file is parsed first, so session data is in memory.
The cwd session is loaded, triggering autosave
autosave saves the blank Neovim buffers into the cwd session file
session is loaded from data in memory.
While this works, if you have other autosave settings turned off (or Neovim crashes etc), then there is a chance the session will be lost.
Ideally, we skip saving when autoloading from cwd. It looks like this was the intent, and autosave_skip() has a bug. I don't know the nuance of Neovim that the skip function is trying to achieve, but results from my tests are below:
localfunctionautosave_skip()
-- Skip scratch buffer e.g. startscreenlocalunscratch_buffers=vim.tbl_filter(function(buf)
return'nofile' ~=vim.bo[buf].buftypeend, vim.api.nvim_list_bufs())
-- unscratch_buffers is true-- next(unscratch_buffers) is true-- so return evaluates to falsereturnnotunscratch_buffersornotnext(unscratch_buffers)
end
The text was updated successfully, but these errors were encountered:
Relates to #55
If configured with
autosave.cwd = true
andautoload.cwd = true
, when starting NeovimM.load
insession.lua
will try to autosave. It looks like this should be skipped but for whatever reason,autosave_skip()
is returning true for me.This has the follow behaviour:
cwd
json file is parsed first, so session data is in memory.cwd
session is loaded, triggering autosavecwd
session fileWhile this works, if you have other autosave settings turned off (or Neovim crashes etc), then there is a chance the session will be lost.
Ideally, we skip saving when autoloading from
cwd
. It looks like this was the intent, andautosave_skip()
has a bug. I don't know the nuance of Neovim that the skip function is trying to achieve, but results from my tests are below:The text was updated successfully, but these errors were encountered: