-
Notifications
You must be signed in to change notification settings - Fork 321
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
expand $left/$right in edit-args, replace all $variable matches #1211
Conversation
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.
Thanks Yuya, this is nice! I have three kinds of comments:
-- Some changes I'd like to see in the documentation. If you don't feel like doing them here, feel free to leave them for me to do in another PR.
-- I would rather not change all the default configs to explicitly include $left $right
, unless you feel strongly about that.
-- Some minor take-it-or-leave-it thoughts about the code.
The default edit_args will be changed to ["$left", "$right"] to support variable substitution without breaking the existing configuration too much. The default merge_args could also be set if we could come up with something meaningful.
…strings The assumption here is temp_dir wouldn't contain invalid utf-8 bytes. If it can contain invalid bytes, maybe we can remove temp_dir from arguments, and chdir(temp_dir) instead. This unblocks the use of Regex. We could use regex::bytes, but it's way more complex as we would have to go back and forth between str/OsStr and bytes.
I'll add string interpolation support to edit-args.
And set edit_args = ["$left", "$right"] by default.
Checklist
If applicable:
CHANGELOG.md