| author | |
| committer | |
| log | 228862ac564e8753e56286ee9936ce8352570768 |
| tree | 315b31055fdcbc02239cc7a2b141c5b8f92b1394 |
| parent | bc22a71f10acf5d56ebc6f7b13966a7fc8fdc504 |
3 files changed, 7 insertions(+), 21 deletions(-)
KEYBINDINGS.md+3-2| ... | ... | @@ -23,8 +23,9 @@ See the full schema for more details: [`packages/contracts/src/keybindings.ts`]( |
| 23 | 23 | { "key": "mod+d", "command": "terminal.split", "when": "terminalFocus" }, |
| 24 | 24 | { "key": "mod+n", "command": "terminal.new", "when": "terminalFocus" }, |
| 25 | 25 | { "key": "mod+w", "command": "terminal.close", "when": "terminalFocus" }, |
| 26 | { "key": "mod+shift+o", "command": "chat.new" }, | |
| 27 | { "key": "mod+shift+n", "command": "chat.newLocal" }, | |
| 26 | { "key": "mod+n", "command": "chat.new", "when": "!terminalFocus" }, | |
| 27 | { "key": "mod+shift+o", "command": "chat.new", "when": "!terminalFocus" }, | |
| 28 | { "key": "mod+shift+n", "command": "chat.newLocal", "when": "!terminalFocus" }, | |
| 28 | 29 | { "key": "mod+o", "command": "editor.openFavorite" } |
| 29 | 30 | ] |
| 30 | 31 | ``` |
apps/server/src/keybindings.test.ts+1-17| ... | ... | @@ -1,10 +1,6 @@ |
| 1 | 1 | import { assert, describe, it } from "vitest"; |
| 2 | 2 | |
| 3 | import { | |
| 4 | DEFAULT_KEYBINDINGS, | |
| 5 | compileResolvedKeybindingRule, | |
| 6 | parseKeybindingShortcut, | |
| 7 | } from "./keybindings"; | |
| 3 | import { compileResolvedKeybindingRule, parseKeybindingShortcut } from "./keybindings"; | |
| 8 | 4 | |
| 9 | 5 | describe("server keybindings", () => { |
| 10 | 6 | it("parses shortcuts including plus key", () => { |
| ... | ... | @@ -70,16 +66,4 @@ describe("server keybindings", () => { |
| 70 | 66 | }), |
| 71 | 67 | ); |
| 72 | 68 | }); |
| 73 | ||
| 74 | it("defines defaults for terminal.close and chat.newLocal", () => { | |
| 75 | assert.deepInclude(DEFAULT_KEYBINDINGS, { | |
| 76 | key: "mod+w", | |
| 77 | command: "terminal.close", | |
| 78 | when: "terminalFocus", | |
| 79 | }); | |
| 80 | assert.deepInclude(DEFAULT_KEYBINDINGS, { | |
| 81 | key: "mod+shift+n", | |
| 82 | command: "chat.newLocal", | |
| 83 | }); | |
| 84 | }); | |
| 85 | 69 | }); |
apps/server/src/keybindings.ts+3-2| ... | ... | @@ -29,8 +29,9 @@ export const DEFAULT_KEYBINDINGS: ReadonlyArray<KeybindingRule> = [ |
| 29 | 29 | { key: "mod+d", command: "terminal.split", when: "terminalFocus" }, |
| 30 | 30 | { key: "mod+n", command: "terminal.new", when: "terminalFocus" }, |
| 31 | 31 | { key: "mod+w", command: "terminal.close", when: "terminalFocus" }, |
| 32 | { key: "mod+shift+o", command: "chat.new" }, | |
| 33 | { key: "mod+shift+n", command: "chat.newLocal" }, | |
| 32 | { key: "mod+n", command: "chat.new", when: "!terminalFocus" }, | |
| 33 | { key: "mod+shift+o", command: "chat.new", when: "!terminalFocus" }, | |
| 34 | { key: "mod+shift+n", command: "chat.newLocal", when: "!terminalFocus" }, | |
| 34 | 35 | { key: "mod+o", command: "editor.openFavorite" }, |
| 35 | 36 | ]; |
| 36 | 37 |