persisted.nvim/lua/persisted
Rafael Bodill 315cd1a8a5
fix: unnecessary shell commands when autosave off (#85)
* fix: unnecessary shell commands when autosave off

Problem:    Shell programs aren't able to detect nvim exit.

Solution:   Avoid running shell-commands unnecessarily on exit.

Programs that spawn nvim in-order to edit a file are unable to detect
nvim exit cleanly because of a race-condition that happens in
`VimLeavePre` and `get_current()` which runs shell commands during exit
even when `autosave` is off.

For example, using nvim nightly, run persisted.nvim with:

```lua
opts.should_autosave = function()
	-- Do not autosave if git commit/rebase session.
	return vim.env.GIT_EXEC_PATH == nil
end
```

And run `EDITOR=nvim git commit` from shell; git will fail waiting for
nvim to exit cleanly.

* fix: global variable in lowercase initial
2023-08-11 14:07:50 +01:00
..
config.lua refactor: remove deprecations 2023-03-09 09:41:22 +00:00
deprecate.lua refactor: remove deprecations 2023-03-09 09:41:22 +00:00
init.lua fix: unnecessary shell commands when autosave off (#85) 2023-08-11 14:07:50 +01:00
utils.lua feat: add global variable for last loaded session 2023-07-26 16:17:42 +01:00