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

Invalid key code when mapping "-" #12190

Closed
tzemanovic opened this issue Dec 5, 2024 · 0 comments · Fixed by #12191
Closed

Invalid key code when mapping "-" #12190

tzemanovic opened this issue Dec 5, 2024 · 0 comments · Fixed by #12191
Labels
C-bug Category: This is a bug

Comments

@tzemanovic
Copy link
Contributor

Summary

Trying to map a "-" key to an action causes parsing failure.

Looking at the code, this is because '-' is used as a modifier separator and "minus" should be used instead. This restriction is not clear from docs alone, but imho rather than documenting it, it would be better to improve the parser to allow it as there is no ambiguity:

  • without a modifier "-": on it's own it is clear we're binding to this char
  • with a modifier "A--": arguably not as readable as "A-minus"`, but the middle '-' must be a separator and the '-' the key code
  • invalid binding "A-": missing key code

Reproduction Steps

trying to map a "-" key to an action with e.g.:

[keys.normal.space.w]
"-" = "hsplit"

causes a failure

Bad config: TOML parse error at line x, column y
    |
x | "-" = "hsplit"
    | ^^^
Invalid key code ''

Helix log

No response

Platform

cross-platform

Terminal Emulator

any

Installation Method

source

Helix Version

helix 24.7 (cf81e15)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant