Skip to content
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

fix: allow to parse "-" as a key code #12191

Merged
merged 6 commits into from
Dec 6, 2024

Conversation

tzemanovic
Copy link
Contributor

closes #12190

@the-mikedavis
Copy link
Member

Parsing - is ok (also see #8475 which accepts it for macros) but I'd like to continue rejecting <Mod>-- since it's not very readable.

@tzemanovic
Copy link
Contributor Author

Parsing - is ok (also see #8475 which accepts it for macros) but I'd like to continue rejecting <Mod>-- since it's not very readable.

sounds good, thanks! I made the change

helix-view/src/input.rs Outdated Show resolved Hide resolved
helix-view/src/input.rs Outdated Show resolved Hide resolved
tzemanovic and others added 2 commits December 6, 2024 10:09
* We should keep the `tokens.last()` checking in the `match` branch: it
  ensures that we only take this branch if `s` ends with `--` or is `-`.
  Without it this branch would also apply to `S-` for example.
* I've switched the string stuff to `trim_end_matches`. That should
  cover other odd cases like `S---`.
* Instead of popping or clearing the `tokens` we can return early since
  there isn't any work to do parsing modifiers for `'-'`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid key code when mapping "-"
2 participants