Skip to content

Support autoloading session for the current git repository #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 7, 2024

Conversation

nuchs
Copy link
Contributor

@nuchs nuchs commented Jun 7, 2024

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.

@Shatur
Copy link
Owner

Shatur commented Jun 7, 2024

Thanks, looks good to me. Please, apply the formatting suggested by CI and I will merge it.

@Shatur Shatur merged commit 29f80e9 into Shatur:master Jun 7, 2024
2 checks passed
@Shatur Shatur mentioned this pull request Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants