Update keymap configuration in App.tsx

This commit is contained in:
2026-02-01 04:11:09 +01:00
parent 2265ae70b5
commit f4baeeca3d

View File

@@ -8,7 +8,7 @@ import { getCurrentWindow } from "@tauri-apps/api/window";
import { appDataDir } from "@tauri-apps/api/path";
import { listen } from "@tauri-apps/api/event";
import { invoke } from "@tauri-apps/api/core";
import { Compartment, EditorState, Transaction } from "@codemirror/state";
import { Compartment, EditorState, Transaction, Prec } from "@codemirror/state";
import {
EditorView,
keymap,
@@ -397,7 +397,8 @@ export default function App() {
useEffect(() => {
const view = editorViewRef.current;
if (!view) return;
const keys = keymap.of([
const keys = Prec.high(
keymap.of([
{
key: "Tab",
run: () => {
@@ -414,7 +415,8 @@ export default function App() {
return true;
}
}
]);
])
);
view.dispatch({
effects: tabKeymapCompartmentRef.current.reconfigure(keys)
});