Skip to content
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

Assume first dir if only one is configured #84

Closed
wants to merge 1 commit into from

Conversation

codybuell
Copy link
Contributor

Closes #78

Adds support to cd into a directory if Corpus is not currently in one and only has one configured. Not sure if it makes sense to set num_dirs on init or where it currently is on each call to cmdline_changed. Can move it if you'd like it elsewhere.

@wincent
Copy link
Owner

wincent commented Sep 1, 2023

Great idea. I think given that cmdline_changed can be called often, it makes sense to cache the value and re-use it. That'll be a small tweak, so I can take it from here.

Thanks for the PR!

@wincent wincent closed this in f622d3d Sep 4, 2023
@wincent
Copy link
Owner

wincent commented Sep 4, 2023

Thanks once again for the PR, @codybuell. This is merged now.

In the end, I decided to hide this behind a config flag because running :cd without the user explicitly asking for it might be a bit aggressive, so it's best to make it opt-in.

To activate the behavior — in Vimscript:

let g:CorpusAutoCd=1

In Lua:

vim.g.CorpusAutoCd = 1

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.

Assume first directory if only one is configured
2 participants