Add folding keyboard shortcuts

This commit is contained in:
Quinten Kock 2025-11-10 22:37:05 +01:00
parent fd1956dbf6
commit bde88881b2
1 changed files with 2 additions and 0 deletions

View File

@ -18,6 +18,7 @@ import {
foldGutter, foldGutter,
indentOnInput, indentOnInput,
bracketMatching, bracketMatching,
foldKeymap,
} from "@codemirror/language"; } from "@codemirror/language";
import { languages } from "@codemirror/language-data"; import { languages } from "@codemirror/language-data";
import { highlightSelectionMatches, searchKeymap } from "@codemirror/search"; import { highlightSelectionMatches, searchKeymap } from "@codemirror/search";
@ -54,6 +55,7 @@ export class Editor {
const kmap = keymap.of([ const kmap = keymap.of([
...defaultKeymap, ...defaultKeymap,
...searchKeymap, ...searchKeymap,
...foldKeymap,
{ key: "Mod-z", run: () => undo(file.target) }, { key: "Mod-z", run: () => undo(file.target) },
{ key: "Mod-shift-z", run: () => redo(file.target) }, { key: "Mod-shift-z", run: () => redo(file.target) },
{ {