Skip to content

fix: parse legacy plus-separated key bindings - #3181

Open
sanketpatel32 wants to merge 1 commit into
Acode-Foundation:mainfrom
sanketpatel32:devin/1796502491-fix-legacy-keybinding-parser
Open

sanketpatel32 wants to merge 1 commit into
Acode-Foundation:mainfrom
sanketpatel32:devin/1796502491-fix-legacy-keybinding-parser

Conversation

@sanketpatel32

Copy link
Copy Markdown
Contributor

Summary

  • Normalize legacy + modifier separators before parsing key strokes, so stored bindings such as Ctrl+-, Ctrl+_, and Ctrl+= retain their modifiers.
  • Preserve literal + key bindings such as Ctrl-+; no default bindings are changed.
  • Add Vitest regression coverage for the legacy parser behavior.

Root cause

Custom .key-bindings.json values loaded by loadCustomKeyBindings() are split on | and converted with toCodeMirrorKey(). Older Acode releases wrote decreaseFontSize as Ctrl+-|Ctrl-_; the parser only recognized - as a separator, so Ctrl+ was treated as an unrecognized key token and then overwritten by -, binding the bare key.

Tests

  • npx vitest run tests/unit/keyBindingUtils.test.js
  • npm test -- --maxWorkers=4 (1447 passed)
  • npm run check
  • npm run format
  • npm run typecheck

Fixes #3178

@greptile-apps

greptile-apps Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge.

Summary

This PR fixes legacy + separators before parsing key bindings.

  • Older plus-separated shortcuts now keep their modifiers when the editor parses them.

Reviews (1) · Last reviewed commit: "fix: parse legacy plus-separated key bin..." · Reviewed by Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

error in key-binding.json

1 participant