feat(editor): add toggle fold shortcut

This commit is contained in:
yangqinlong authored and GitHub committed 2026-07-29 18:42:43 +08:00
1 parent 1a6e00acbb
commit b1f0784d49
11 files changed
+21 -1

No files matched your search

@@ -19,6 +19,7 @@ describe("shortcutRegistry editor actions", () => {
"uppercaseSelection",
"lowercaseSelection",
"exPasteSqlInCondition",
"toggleFold",
];
const sidebarShortcutActionIds: ShortcutActionId[] = ["copySidebarSelection", "pasteSidebarSelection", "editSidebarConnection"];
@@ -100,6 +101,7 @@ describe("shortcutRegistry editor actions", () => {
expect(shortcuts.uppercaseSelection).toBe("Shift+Alt+U");
expect(shortcuts.lowercaseSelection).toBe("Shift+Alt+L");
expect(shortcuts.exPasteSqlInCondition).toBe("");
expect(shortcuts.toggleFold).toBe("Mod+.");
});
it("detects conflicts between formatter editor shortcuts and other editor shortcuts", () => {
@@ -21,6 +21,7 @@ export type ShortcutActionId =
| "uppercaseSelection"
| "lowercaseSelection"
| "exPasteSqlInCondition"
| "toggleFold"
| "copyCurrentRow"
| "deleteCurrentRow"
| "newQuery"
@@ -202,6 +203,12 @@ export const SHORTCUT_DEFINITIONS: ShortcutDefinition[] = [
scope: "editor",
defaultShortcut: "",
},
{
id: "toggleFold",
labelKey: "settings.shortcutToggleFold",
scope: "editor",
defaultShortcut: "Mod+.",
},
{
id: "copyCurrentRow",
labelKey: "settings.shortcutCopyCurrentRow",