-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Implement change_directory/show_directory commands #335
Conversation
Thanks for contributing!
I think this would be a worthwhile change now that Lines 43 to 44 in aca9d73
String , that way one could ? or return Err(string.into())
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you! I suggest changing just one little detail, but I'm not blocking. You also need to fix lints (see CI, but that's basically cargo clippy
+ cargo fmt
).
Also, what about change-working-directory
and show-working-directory
for names?
As an aside, I think it would be nice if TypableCommands returned a Result<()> …
Agreed! Do you plan on doing a PR for that next?
Yeah I think I can submit a PR for the |
Oh I just your point regarding the naming, I'm absolutely fine renaming them. For the record both Vim and Rust call it the "current directory", so an alternative could be |
No hurry 🙂
I'm fine with either one. Just take |
Arg, I used the "working" version. Well let me amend it quickly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you!
These commands let the user check and change the current working directory for the running helix session.
I mostly implemented those to play with the codebase but I thought they might be useful (they would be useful to me at least, I regularly change the working directory in vim).
As an aside, I think it would be nice if TypableCommands returned a Result<()> and any error was automatically logged using
editor.set_error(_)
, that would let onebail!
out of a command implementation without having to manually calleditor.set_error(format!(...)); return;
. I could submit such a change if it was deemed acceptable.