| ... | @@ -98,7 +98,9 @@ const DEFAULT_BINDINGS = compile([ | ... | @@ -98,7 +98,9 @@ const DEFAULT_BINDINGS = compile([ |
| 98 | describe("isTerminalToggleShortcut", () => { | 98 | describe("isTerminalToggleShortcut", () => { |
| 99 | it("matches Cmd+J on macOS", () => { | 99 | it("matches Cmd+J on macOS", () => { |
| 100 | assert.isTrue( | 100 | assert.isTrue( |
| 101 | isTerminalToggleShortcut(event({ metaKey: true }), DEFAULT_BINDINGS, { platform: "MacIntel" }), | 101 | isTerminalToggleShortcut(event({ metaKey: true }), DEFAULT_BINDINGS, { |
| | 102 | platform: "MacIntel", |
| | 103 | }), |
| 102 | ); | 104 | ); |
| 103 | }); | 105 | }); |
| 104 | | 106 | |
| ... | @@ -219,7 +221,10 @@ describe("shortcutLabelForCommand", () => { | ... | @@ -219,7 +221,10 @@ describe("shortcutLabelForCommand", () => { |
| 219 | whenAst: whenNot(whenIdentifier("terminalFocus")), | 221 | whenAst: whenNot(whenIdentifier("terminalFocus")), |
| 220 | }, | 222 | }, |
| 221 | ]); | 223 | ]); |
| 222 | assert.strictEqual(shortcutLabelForCommand(bindings, "terminal.split", "Linux"), "Ctrl+Shift+\\"); | 224 | assert.strictEqual( |
| | 225 | shortcutLabelForCommand(bindings, "terminal.split", "Linux"), |
| | 226 | "Ctrl+Shift+\\", |
| | 227 | ); |
| 223 | }); | 228 | }); |
| 224 | | 229 | |
| 225 | it("returns labels for non-terminal commands", () => { | 230 | it("returns labels for non-terminal commands", () => { |
| ... | @@ -247,22 +252,14 @@ describe("chat/editor shortcuts", () => { | ... | @@ -247,22 +252,14 @@ describe("chat/editor shortcuts", () => { |
| 247 | | 252 | |
| 248 | it("matches chat.newLocal shortcut", () => { | 253 | it("matches chat.newLocal shortcut", () => { |
| 249 | assert.isTrue( | 254 | assert.isTrue( |
| 250 | isChatNewLocalShortcut( | 255 | isChatNewLocalShortcut(event({ key: "n", metaKey: true, shiftKey: true }), DEFAULT_BINDINGS, { |
| 251 | event({ key: "n", metaKey: true, shiftKey: true }), | 256 | platform: "MacIntel", |
| 252 | DEFAULT_BINDINGS, | 257 | }), |
| 253 | { | | |
| 254 | platform: "MacIntel", | | |
| 255 | }, | | |
| 256 | ), | | |
| 257 | ); | 258 | ); |
| 258 | assert.isTrue( | 259 | assert.isTrue( |
| 259 | isChatNewLocalShortcut( | 260 | isChatNewLocalShortcut(event({ key: "n", ctrlKey: true, shiftKey: true }), DEFAULT_BINDINGS, { |
| 260 | event({ key: "n", ctrlKey: true, shiftKey: true }), | 261 | platform: "Linux", |
| 261 | DEFAULT_BINDINGS, | 262 | }), |
| 262 | { | | |
| 263 | platform: "Linux", | | |
| 264 | }, | | |
| 265 | ), | | |
| 266 | ); | 263 | ); |
| 267 | }); | 264 | }); |
| 268 | | 265 | |
| ... | @@ -344,11 +341,17 @@ describe("cross-command precedence", () => { | ... | @@ -344,11 +341,17 @@ describe("cross-command precedence", () => { |
| 344 | | 341 | |
| 345 | describe("formatShortcutLabel", () => { | 342 | describe("formatShortcutLabel", () => { |
| 346 | it("formats labels for macOS", () => { | 343 | it("formats labels for macOS", () => { |
| 347 | assert.strictEqual(formatShortcutLabel(modShortcut("d", { shiftKey: true }), "MacIntel"), "⇧⌘D"); | 344 | assert.strictEqual( |
| | 345 | formatShortcutLabel(modShortcut("d", { shiftKey: true }), "MacIntel"), |
| | 346 | "⇧⌘D", |
| | 347 | ); |
| 348 | }); | 348 | }); |
| 349 | | 349 | |
| 350 | it("formats labels for non-macOS", () => { | 350 | it("formats labels for non-macOS", () => { |
| 351 | assert.strictEqual(formatShortcutLabel(modShortcut("d", { shiftKey: true }), "Linux"), "Ctrl+Shift+D"); | 351 | assert.strictEqual( |
| | 352 | formatShortcutLabel(modShortcut("d", { shiftKey: true }), "Linux"), |
| | 353 | "Ctrl+Shift+D", |
| | 354 | ); |
| 352 | }); | 355 | }); |
| 353 | | 356 | |
| 354 | it("formats labels for plus key", () => { | 357 | it("formats labels for plus key", () => { |
| ... | @@ -368,7 +371,9 @@ describe("isTerminalClearShortcut", () => { | ... | @@ -368,7 +371,9 @@ describe("isTerminalClearShortcut", () => { |
| 368 | }); | 371 | }); |
| 369 | | 372 | |
| 370 | it("ignores non-keydown events", () => { | 373 | it("ignores non-keydown events", () => { |
| 371 | assert.isFalse(isTerminalClearShortcut(event({ type: "keyup", key: "l", ctrlKey: true }), "Linux")); | 374 | assert.isFalse( |
| | 375 | isTerminalClearShortcut(event({ type: "keyup", key: "l", ctrlKey: true }), "Linux"), |
| | 376 | ); |
| 372 | }); | 377 | }); |
| 373 | }); | 378 | }); |
| 374 | | 379 | |
| ... | @@ -413,7 +418,9 @@ describe("terminalNavigationShortcutData", () => { | ... | @@ -413,7 +418,9 @@ describe("terminalNavigationShortcutData", () => { |
| 413 | "MacIntel", | 418 | "MacIntel", |
| 414 | ), | 419 | ), |
| 415 | ); | 420 | ); |
| 416 | assert.isNull(terminalNavigationShortcutData(event({ key: "ArrowLeft", metaKey: true }), "Linux")); | 421 | assert.isNull( |
| | 422 | terminalNavigationShortcutData(event({ key: "ArrowLeft", metaKey: true }), "Linux"), |
| | 423 | ); |
| 417 | assert.isNull(terminalNavigationShortcutData(event({ key: "a", altKey: true }), "MacIntel")); | 424 | assert.isNull(terminalNavigationShortcutData(event({ key: "a", altKey: true }), "MacIntel")); |
| 418 | }); | 425 | }); |
| 419 | | 426 | |