Closed MasouShizuka closed 6 months ago
Thanks for this.
Quick glance and looks good. I added a global variable a couple of days ago vim.g.persisted_exists
...could that be utilised in the should_autosave
callback? Or, could we pass the current session to the callback?
I think that would accomplish your ask, take up less lines of code and always bring more possibilities to the callback.
It's possible, but this requires changing session_exists()
or vim.g.persisted_exists
.
Specifically, put the session called by write()
in save()
into session_exists()
instead of just determining whether the session file in the current working directory exists.
vim.g.persisted_exists
also needs to be changed based on conditions, such as the working directory changing when follow_cwd=true
.
I personally think that this global variable can be completely replaced by session_exists()
.
To do this, user need to put the session_exists()
API into the should_autosave
function.
As discussed #95.