-
-
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
Make parse_macro work for "-" outside "<..>" #8475
Make parse_macro work for "-" outside "<..>" #8475
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.
-
isn't a valid part of a key sequence though, it's only used for connecting multiple keys into a chord like C-c
, and minus
stands for the -
key. So parsing it into a KeyEvent or in parse_macro isn't correct.
Instead we could encode filenames as key sequences (so a-b.txt
would become a<minus>b.txt
). It might be possible to use <C-r>%
to enter the buffer name into the prompt in the test cases instead though which would be simpler.
This was my second solution to the issue. I wasn't sure. Thanks for the feedback. Will fix when I'm back after the weekend. |
I understand why For example So, because of this it feels to me that the correct solution would be to check for What am I missing here? |
198a91c
to
0a66161
Compare
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 was mostly worried about KeyEvent, it seems ok for parse_macro. I would prefer that converting to/from the key sequence format be round-trip, so parsing then encoding a key sequence would give the input string. Being able to use -
in a macro should be very convenient though so I'm ok with the change here.
The solution I had in mind was to encode the path in terms of a key sequence. Other than minus I don't think we have any special characters that are also valid in path names though so I don't think we really need that solution.
* Translate to when a part of the outher string in * Changed the if a little
* Translate to when a part of the outher string in * Changed the if a little
* Translate to when a part of the outher string in * Changed the if a little
* Translate to when a part of the outher string in * Changed the if a little
When running the integration tests, I ended up with temp file paths containing "-" in the name. This in turn triggered an issue where the key "" could not be resolved. This is one way of fixing this issue, another is to check for "-" in parse_macro() and replace it with "minus".