Skip to content

Commit fc5dea7

Browse files
committed
Fix arrow display
1 parent d44016d commit fc5dea7

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

packages/commands/src/index.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,7 @@ export namespace CommandRegistry {
12191219
export function formatKeystroke(keystroke: string): string {
12201220
let mods = '';
12211221
let parts = parseKeystroke(keystroke);
1222+
let keyWithoutArrows = parts.key.replace('Arrow(Left|Down|Up|Right)', '');
12221223
if (Platform.IS_MAC) {
12231224
if (parts.ctrl) {
12241225
mods += '\u2303 ';
@@ -1232,18 +1233,6 @@ export namespace CommandRegistry {
12321233
if (parts.cmd) {
12331234
mods += '\u2318 ';
12341235
}
1235-
if (parts.arrowLeft) {
1236-
mods += '\u2190 ';
1237-
}
1238-
if (parts.arrowUp) {
1239-
mods += '\u2191 ';
1240-
}
1241-
if (parts.arrowRight) {
1242-
mods += '\u2192 ';
1243-
}
1244-
if (parts.arrowDown) {
1245-
mods += '\u2193 ';
1246-
}
12471236
} else {
12481237
if (parts.ctrl) {
12491238
mods += 'Ctrl+';
@@ -1255,7 +1244,20 @@ export namespace CommandRegistry {
12551244
mods += 'Shift+';
12561245
}
12571246
}
1258-
return mods + parts.key;
1247+
// regardless of platform
1248+
if (parts.arrowLeft) {
1249+
mods += '\u2190 ';
1250+
}
1251+
if (parts.arrowUp) {
1252+
mods += '\u2191 ';
1253+
}
1254+
if (parts.arrowRight) {
1255+
mods += '\u2192 ';
1256+
}
1257+
if (parts.arrowDown) {
1258+
mods += '\u2193 ';
1259+
}
1260+
return mods + keyWithoutArrows;
12591261
}
12601262

12611263
/**

0 commit comments

Comments
 (0)