Renamed "keyboardShortcuts" to "shortcuts"

This commit is contained in:
Zef Hemel
2023-12-27 08:14:57 +01:00
parent 4759a20b23
commit a205178ff0
4 changed files with 36 additions and 28 deletions
+6 -4
View File
@@ -26,13 +26,15 @@ export function CommandPalette({
const isMac = isMacLike();
for (const [name, def] of commands.entries()) {
let shortcut: { key?: string; mac?: string } = def.command;
// Let's see if there's a keyboard shortcut override
if (settings.keyboardShortcuts) {
const commandKeyboardOverride = settings.keyboardShortcuts.find((
// Let's see if there's a shortcut override
if (settings.shortcuts) {
const commandKeyboardOverride = settings.shortcuts.find((
shortcut,
) => {
const commandMatch = commandLinkRegex.exec(shortcut.command);
return commandMatch && commandMatch[1] === name ||
// If this is a command link, we want to match the command name but also make sure no arguments were set
return commandMatch && commandMatch[1] === name && !commandMatch[5] ||
// or if it's not a command link, let's match exactly
shortcut.command === name;
});
if (commandKeyboardOverride) {