Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/content_scripts/common/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,17 @@ function createAPI(clipboard, insert, normal, hints, visual, front, browser) {
}, new_annotation ? parseAnnotation({ annotation: new_annotation }) : null, false);
normal.mappings.add(KeyboardUtils.encodeKeystroke(new_keystroke), keybound);
} else {
if (!mapInMode(normal, new_keystroke, old_keystroke) && old_keystroke in Mode.specialKeys) {
const map = mapInMode(normal, new_keystroke, old_keystroke);
// update the new annotation
if(map && new_annotation) {
const keys = KeyboardUtils.encodeKeystroke(new_keystroke);
const newMap = normal.mappings.find(keys);
const ano = parseAnnotation({ annotation: new_annotation });
newMap.meta.annotation = ano.annotation;
newMap.meta.feature_group = ano.feature_group ?? 0;
}

if (!map && old_keystroke in Mode.specialKeys) {
Mode.specialKeys[old_keystroke].push(new_keystroke);
dispatchSKEvent('addMapkey', ["Mode", new_keystroke, old_keystroke]);
} else {
Expand Down
34 changes: 17 additions & 17 deletions src/content_scripts/ui/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,23 +293,23 @@ const Front = (function() {

function buildUsage(metas, cb) {
var feature_groups = [
'Help', // 0
'Mouse Click', // 1
'Scroll Page / Element', // 2
'Tabs', // 3
'Page Navigation', // 4
'Sessions', // 5
'Search selected with', // 6
'Clipboard', // 7
'Omnibar', // 8
'Visual Mode', // 9
'vim-like marks', // 10
'Settings', // 11
'Chrome URLs', // 12
'Proxy', // 13
'Misc', // 14
'Insert Mode', // 15
'Lurk Mode', // 16
'0 Help',
'1 Mouse Click',
'2 Scroll Page / Element',
'3 Tabs',
'4 Page Navigation',
'5 Sessions',
'6 Search selected with',
'7 Clipboard',
'8 Omnibar',
'9 Visual Mode',
'10 vim-like marks',
'11 Settings',
'12 Chrome URLs',
'13 Proxy',
'14 Misc',
'15 Insert Mode',
'16 Lurk Mode',
];

initL10n(function(locale) {
Expand Down