HotKeys Bug Fixes

This commit is contained in:
2026-07-22 10:39:29 -04:00
parent 5f6b2b3883
commit ea53f92f62
8 changed files with 463 additions and 39 deletions
+1 -17
View File
@@ -7,12 +7,7 @@
highlightActiveLine,
} from "@codemirror/view";
import { EditorState, Compartment, StateField } from "@codemirror/state";
import {
defaultKeymap,
history,
historyKeymap,
indentWithTab,
} from "@codemirror/commands";
import { defaultKeymap, history, indentWithTab } from "@codemirror/commands";
import {
bracketMatching,
indentOnInput,
@@ -46,7 +41,6 @@
diagnostics?: Diagnostic[];
collab?: { text: Y.Text; awareness: Awareness } | null;
onchange: (value: string) => void;
onsave: () => void;
onlspstatus?: (status: "off" | "starting" | "on" | "unavailable") => void;
onready?: (view: EditorView | null) => void;
}
@@ -59,7 +53,6 @@
diagnostics = [],
collab = null,
onchange,
onsave,
onlspstatus,
onready,
}: Props = $props();
@@ -170,17 +163,8 @@
: [autocompletion({ override: [typstCompletions] })]),
EditorView.lineWrapping,
keymap.of([
{
key: "Mod-s",
preventDefault: true,
run: () => {
onsave();
return true;
},
},
...closeBracketsKeymap,
...defaultKeymap,
...historyKeymap,
indentWithTab,
]),
EditorView.updateListener.of((update) => {