fix(config): support Unicode keymap aliases - #1004
Conversation
Resolve keyboard.toml aliases on UTF-8 character boundaries so non-English names no longer panic. Add regression coverage, documentation, and a changelog entry for rmk-rs#569.
Size Report
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46d66a2247
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let alias_len = current_keys[alias_start..] | ||
| .find(char::is_whitespace) | ||
| .unwrap_or(current_keys.len() - alias_start); |
There was a problem hiding this comment.
Make Unicode alias separators valid keymap whitespace
When an alias is followed by non-ASCII whitespace such as NBSP or an ideographic space, this scan ends the alias at that character but leaves the separator in next_keys. The unchanged keymap.pest WHITESPACE rule accepts only space, tab, newline, and carriage return, so the Unicode separator is absorbed into an adjacent loose_identifier or causes parsing to fail, producing an invalid action or incorrect key count. Normalize/consume these separators during expansion or extend the grammar to recognize the same whitespace set.
Useful? React with 👍 / 👎.
|
This cannot close #569 |
Fixes #569.
Summary
Validation
cargo test --manifest-path rmk-config/Cargo.toml --lib(28 tests passed)cargo clippy --manifest-path rmk-config/Cargo.toml --all-targets --all-features -- -D warningscargo fmt --all -- --checkDesign scope
This intentionally keeps the existing
[aliases]format and resolution semantics; it only makes identifier scanning Unicode-safe.