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
Editing a snippet in an editor #104
Comments
Been looking at this again and it only behaves like this if the command/snippet is a single line. Happy to submit a PR for this but not sure what the preferred behaviour would be. Options I can think of:
|
Ah yes, good point, it's not super obvious now. I personally would prefer option 3
since spinning up an editor for a single line command seems unnecessary in most cases - but let me know if you think otherwise or there are cases I'm not thinking of where editor support would be useful. |
Another alternative would be to use a different key combo (Shift-Enter for instance) to open up the editor in this case - so would need a change in the prompt and behaviour. |
The only issue I can see is if you want to add a second line to a single line command. Not sure how common a use case that is though. How easy is it to handle key-combos from Dialoguer? I think that would be the best of both worlds but is probably the most involved change. |
Oh this is a great point, hadn't considered it. Also, looks like dialoguer has some issues with certain characters (e.g. #128) so I think your Option 1 ( Open the editor for all snippets immediately instead of using the prompt ) makes the most sense now, even if it is a bit cumbersome for single line snippets. Would you be up for making a PR? |
Sure, will have a look this evening.
Thinking about this, would a fourth option be to prompt for |
Previously if a snippet was a single line, there was no way of opening it in an external editor. This meant (among other things) that is was not possible to add a line break to a single line snippet. It also meant for multi line snippets that the editor had to be opened and closed in order for the edit to be completed even if the user only wanted to edit tags or description. This is slightly more involved when making simple edits to single lines but the consistency across all snippets makes it clearer how things work. Fixes out-of-cheese-error#104
Previously if a snippet was a single line, there was no way of opening it in an external editor. This meant (among other things) that is was not possible to add a line break to a single line snippet. It also meant for multi line snippets that the editor had to be opened and closed in order for the edit to be completed even if the user only wanted to edit tags or description. This is slightly more involved when making simple edits to single lines but the consistency across all snippets makes it clearer how things work. Fixes out-of-cheese-error#104
Yep, I like this idea! And yeah EDITOR could be anything so it's a pretty good way to make sure you don't open it unless you want to. |
When editing an existing snippet (
the-way search -> select -> shift+right
), after confirming the other fields, the prompt saysCode snippet (<RET> to edit in external editor)
. What is<RET>
in this case? Return/enter appears to only submit the snippet as it is.I have tried with
$EDITOR
both unset and set tovi
.The text was updated successfully, but these errors were encountered: