fix(keybindings): migrate to namespaced ids closes #2391

This commit is contained in:
Mario Zechner
2026-03-20 01:50:47 +01:00
parent 74a46fc7ea
commit e3fee7a511
43 changed files with 1077 additions and 883 deletions
@@ -12,7 +12,7 @@ import {
Editor,
type EditorOptions,
type Focusable,
getEditorKeybindings,
getKeybindings,
Spacer,
Text,
type TUI,
@@ -20,7 +20,7 @@ import {
import type { KeybindingsManager } from "../../../core/keybindings.js";
import { getEditorTheme, theme } from "../theme/theme.js";
import { DynamicBorder } from "./dynamic-border.js";
import { appKeyHint, keyHint } from "./keybinding-hints.js";
import { keyHint } from "./keybinding-hints.js";
export class ExtensionEditorComponent extends Container implements Focusable {
private editor: Editor;
@@ -78,12 +78,12 @@ export class ExtensionEditorComponent extends Container implements Focusable {
// Add hint
const hasExternalEditor = !!(process.env.VISUAL || process.env.EDITOR);
const hint =
keyHint("selectConfirm", "submit") +
keyHint("tui.select.confirm", "submit") +
" " +
keyHint("newLine", "newline") +
keyHint("tui.input.newLine", "newline") +
" " +
keyHint("selectCancel", "cancel") +
(hasExternalEditor ? ` ${appKeyHint(this.keybindings, "externalEditor", "external editor")}` : "");
keyHint("tui.select.cancel", "cancel") +
(hasExternalEditor ? ` ${keyHint("app.editor.external", "external editor")}` : "");
this.addChild(new Text(hint, 1, 0));
this.addChild(new Spacer(1));
@@ -93,15 +93,15 @@ export class ExtensionEditorComponent extends Container implements Focusable {
}
handleInput(keyData: string): void {
const kb = getEditorKeybindings();
const kb = getKeybindings();
// Escape or Ctrl+C to cancel
if (kb.matches(keyData, "selectCancel")) {
if (kb.matches(keyData, "tui.select.cancel")) {
this.onCancelCallback();
return;
}
// External editor (app keybinding)
if (this.keybindings.matches(keyData, "externalEditor")) {
if (this.keybindings.matches(keyData, "app.editor.external")) {
this.openExternalEditor();
return;
}