-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add external_edit_file_suffix
to config
#253
Add external_edit_file_suffix
to config
#253
Conversation
@@ -557,6 +559,9 @@ impl Tunables { | |||
notifications: self.notifications.or(other.notifications), | |||
image_preview: self.image_preview.or(other.image_preview), | |||
user_gutter_width: self.user_gutter_width.or(other.user_gutter_width), | |||
external_edit_file_suffix: self | |||
.external_edit_file_suffix | |||
.or(other.external_edit_file_suffix), |
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.
I would be fine with an .unwrap_or_else(|| ".md".into())
here. iamb interprets the text as markdown, so that's probably the most useful default.
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.
Cool, PR updated.
external_edit_file_suffix
to config
Merged! Thank you for thinking to add this! 🎉 Getting syntax highlighting is I imagine one of people's big reasons to use an external editor, so this should make that much easier on them. (Although it would be nice to eventually implement it in the message bar, too.) |
Happy to help, and thank you for creating and maintaining iamb! |
When using the
editor
command in iamb, the temporary file currently has no file extension. This is probably a reasonable default behavior, but some users may want to hint to their editor a particular file type such as.md
or.txt
to make use of linters, formatters, spell checkers, or other file type specific editor configurations.This PR
preserves the default behaviorsets the default suffix to.md
while adding aexternal_edit_file_suffix
configuration option which accepts a string to append to the end of the temporary file name passed to the users editor.