* 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
When nvim is used as a man pager with `export MANPAGER='nvim +Man! '`, with autoload set to true, persisted.nvim still autoloads the current directory which is not desirable
- Use telescope builtin resolver to calculate width.
- The branch is missing. Fixed.
- If session file stores without git branch, `session.branch` should be nil. And do not show branch in list.
- `make test` will fail because plenary.nvim is old.
close#34
* Add follow_cwd option to allow fixing session name on load
* Update readme to reflect new follow_cwd command and explain use
* Add tests for follow_cwd
* Update README.md
* Adjust wording in README for follow_cwd to clarify use case
Co-authored-by: Oli M <olimorris@users.noreply.github.com>
For users who not use git branching (majority) this is redundant. For users who have lots of '_' in their file path, this becomes messy. Cleaner to just remove it as the user can determine the branch from the filename anyway