I've stolen the code from the first pull request for checking if we're in a git repo and added a new method to load a session for the root of the git repo if we're in one. It work like the other autoload methods so they can be configured to be tried in order (so I have mine try git, cwd, last)
I saw your comment about gitsigns but to be honest spawning the git process happens so fast that it's imperceptable (or at least it is on my machine). I didn't want to make the code more complicated if it didn't really improve the user expereince but I can add the check if you prefer.
I also had a think about your comment about autosaving being separate, and I agree so I've not tried to tackle that. (In my workflow, I save the session on BufWritePre and so it all just sort of works without any special handling required for the git directory)
Sorry about the formatting change to session_manager.setup, I only noticed my editor had done that after I'd pushed. Happy to put that back if your like.
I've stolen the code from the first pull request for checking if we're in a git repo and added a new method to load a session for the root of the git repo if we're in one. It work like the other autoload methods so they can be configured to be tried in order (so I have mine try git, cwd, last)
I saw your comment about gitsigns but to be honest spawning the git process happens so fast that it's imperceptable (or at least it is on my machine). I didn't want to make the code more complicated if it didn't really improve the user expereince but I can add the check if you prefer.
I also had a think about your comment about autosaving being separate, and I agree so I've not tried to tackle that. (In my workflow, I save the session on BufWritePre and so it all just sort of works without any special handling required for the git directory)
Sorry about the formatting change to
session_manager.setup
, I only noticed my editor had done that after I'd pushed. Happy to put that back if your like.