This commit is contained in:
Gunir 2024-11-05 08:21:44 +07:00 committed by GitHub
commit 7ce777634d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -709,11 +709,16 @@ function zenGetDefaultShortcuts() {
)
);
return newShortcutList;
}
class ZenKeyboardShortcutsVersioner {
static LATEST_KBS_VERSION = 3;
static LATEST_KBS_VERSION = 4;
constructor() {}
@ -768,6 +773,18 @@ class ZenKeyboardShortcutsVersioner {
}
migrate(data, version) {
// Explain: How to add shortcuts
/*
new KeyShortcut(
'ID_OF_SHORTCUT',
'KEYCODE',
'',
GROUP_OF_SHORTCUT,
KeyShortcutModifiers.fromObject({ accel: true, alt: true }), //accel = Ctrl/Cmd, Alt = Alt/Option
'code:NATIVE_CODE_FUNCTION()',
'L10N_STRING_FOR_TRANSLATION'
)
*/
if (version < 1) {
// Migrate from 0 to 1
// Here, we do a complet reset of the shortcuts,
@ -812,6 +829,29 @@ class ZenKeyboardShortcutsVersioner {
}
}
}
data.push(
// Added by gunir
// Prev Tab Ctrl+Left
new KeyShortcut(
'zen-previous-tab',
'VK_LEFT',
'',
ZEN_OTHER_SHORTCUTS_GROUP,
KeyShortcutModifiers.fromObject({ accel: true }),
"code:gBrowser.tabContainer.advanceSelectedTab(-1, true);",
'zen-shortcut-previous-tab'
),
// Next Tab Ctrl+Right
new KeyShortcut(
'zen-next-tab',
'VK_RIGHT',
'',
ZEN_OTHER_SHORTCUTS_GROUP,
KeyShortcutModifiers.fromObject({ accel: true }),
"code:gBrowser.tabContainer.advanceSelectedTab(1, true);",
'zen-shortcut-next-tab'
)
);
return data;
}
}