| ... | @@ -1076,6 +1076,20 @@ describe("isRichTextBoldShortcut", () => { | ... | @@ -1076,6 +1076,20 @@ describe("isRichTextBoldShortcut", () => { |
| 1076 | assert.isTrue(isRichTextBoldShortcut(event({ key: "B", ctrlKey: true }))); | 1076 | assert.isTrue(isRichTextBoldShortcut(event({ key: "B", ctrlKey: true }))); |
| 1077 | }); | 1077 | }); |
| 1078 | | 1078 | |
| | 1079 | it("matches the B key on non-Latin layouts, like the sidebar toggle does", () => { |
| | 1080 | const cyrillicB = event({ key: "и", code: "KeyB", ctrlKey: true }); |
| | 1081 | assert.isTrue(isRichTextBoldShortcut(cyrillicB)); |
| | 1082 | assert.strictEqual( |
| | 1083 | resolveShortcutCommand(cyrillicB, DEFAULT_BINDINGS, { platform: "Win32" }), |
| | 1084 | "sidebar.toggle", |
| | 1085 | ); |
| | 1086 | }); |
| | 1087 | |
| | 1088 | it("follows the letter a Latin layout types, not the physical key", () => { |
| | 1089 | assert.isFalse(isRichTextBoldShortcut(event({ key: "x", code: "KeyB", ctrlKey: true }))); |
| | 1090 | assert.isTrue(isRichTextBoldShortcut(event({ key: "b", code: "KeyN", ctrlKey: true }))); |
| | 1091 | }); |
| | 1092 | |
| 1079 | it("ignores shifted, alted, bare, and non-keydown presses", () => { | 1093 | it("ignores shifted, alted, bare, and non-keydown presses", () => { |
| 1080 | assert.isFalse(isRichTextBoldShortcut(event({ key: "b", metaKey: true, shiftKey: true }))); | 1094 | assert.isFalse(isRichTextBoldShortcut(event({ key: "b", metaKey: true, shiftKey: true }))); |
| 1081 | assert.isFalse(isRichTextBoldShortcut(event({ key: "b", metaKey: true, altKey: true }))); | 1095 | assert.isFalse(isRichTextBoldShortcut(event({ key: "b", metaKey: true, altKey: true }))); |