* 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
A big shoutout to @simonmclean for this pull request. Previously we autoloaded a session file as soon as Neovim opened. The problem with this is that key plugins like LSP and Treesitter may not have been initialised. This would lead to syntax highlighting issues or LSPs not attaching to buffers in the session. Pushing this to Neovim's event loop via vim.schedule allows us to sensibly load the session after these key plugins. Fixing the tests was a little cumbersome as we needed to use plenary's async library but once figured out, we have some lovely robust async tests
I'm experiencing a bug whereby if I enable autoloading, I don't get any syntax highlighting on startup (until I trigger it with `:e` for example). I had the same issue with `persistence.nvim` (I made an auto command to get the same functionality). For both plugins, wrapping the call to `load` in `vim.schedule` solved the problem.
I don't really know enough about the inner workings of Neovim to explain this though.
This addresses #1 and allows the user to specify directories which the plugin will automatically save or load from. Alternatively, specify directories for which this behaviour will be ignored