use our own input method in vscode

The lean one was annoying for \{...}
This commit is contained in:
2025-04-05 10:31:32 -07:00
parent 8c983dd571
commit 590f344516
4 changed files with 52 additions and 11 deletions

1
playground/src/abbrev.ts Symbolic link
View File

@@ -0,0 +1 @@
../../newt-vscode/src/abbrev.ts

View File

@@ -6,6 +6,7 @@ import { h, render } from "preact";
import { ChangeEvent } from "preact/compat";
import { archive, preload } from "./preload.ts";
import { CompileReq, CompileRes, Message } from "./types.ts";
import { ABBREV } from "./abbrev.ts";
// editor.(createModel / setModel / getModels) to switch files
@@ -221,17 +222,6 @@ interface EditorProps {
initialValue: string;
}
const ABBREV: Record<string, string> = {
'\\x': '×',
'\\r': '→',
'\\all': '∀',
'\\\\': '\\',
'\\==': '≡',
'\\circ': '∘',
'\\1': '₁',
'\\2': '₂',
}
function Editor({ initialValue }: EditorProps) {
const ref = useRef<HTMLDivElement>(null);
useEffect(() => {