fix: make go-to-line shortcut work reliably in editor
Option+G now matches correctly on macOS keyboard layouts Go-to-line shortcut no longer gets blocked by editor textbox guards Prevents accidental symbol insertion when triggering go-to-line
This commit is contained in:
@@ -111,6 +111,13 @@ const SHORTCUT_ACTIONS: ReadonlyArray<ShortcutAction> = [
|
||||
description: 'Open the quick open dialog',
|
||||
customizable: true,
|
||||
},
|
||||
{
|
||||
id: 'open_go_to_line',
|
||||
defaultCombo: 'alt+g',
|
||||
label: 'Go to line (files editor)',
|
||||
description: 'Open go to line in the files editor',
|
||||
customizable: true,
|
||||
},
|
||||
{
|
||||
id: 'open_command_palette',
|
||||
defaultCombo: 'mod+k',
|
||||
@@ -571,7 +578,16 @@ export function eventMatchesShortcut(
|
||||
}
|
||||
}
|
||||
|
||||
const eventKey = keyToShortcutToken(event.key);
|
||||
let eventKeyRaw = event.key;
|
||||
if (event.altKey) {
|
||||
if (event.code.startsWith('Key') && event.code.length === 4) {
|
||||
eventKeyRaw = event.code.slice(3).toLowerCase();
|
||||
} else if (event.code.startsWith('Digit') && event.code.length === 6) {
|
||||
eventKeyRaw = event.code.slice(5);
|
||||
}
|
||||
}
|
||||
|
||||
const eventKey = keyToShortcutToken(eventKeyRaw);
|
||||
const expectedKey = keyToShortcutToken(parsed.key);
|
||||
|
||||
return eventKey === expectedKey;
|
||||
|
||||
Reference in New Issue
Block a user