Fix a bunch of lints

This commit is contained in:
Quinten Kock 2025-11-10 03:10:29 +01:00
parent 0ede7607c8
commit e84a5192c5
2 changed files with 8 additions and 19 deletions

View File

@ -38,13 +38,6 @@ const fixedHeightEditor = EditorView.theme({
".cm-scroller": { overflow: "auto scroll" },
});
const testTheme = EditorView.theme({
"&": {
width: "600px",
resize: "horizontal",
},
});
export class Editor {
view: EditorView;
file: OpenFile;
@ -97,14 +90,11 @@ export class Editor {
// lintKeymap,
],
});
const language = LanguageDescription.matchFilename(
languages,
file.filePath.val,
)
LanguageDescription.matchFilename(languages, file.filePath.val)
?.load()
.then((Lang) => {
let eff = StateEffect.appendConfig.of(Lang);
let tr = this.view.dispatch({ effects: [eff] });
const eff = StateEffect.appendConfig.of(Lang);
this.view.dispatch({ effects: [eff] });
});
}

View File

@ -8,8 +8,7 @@ import {
} from "@codemirror/state";
import { history } from "@codemirror/commands";
import { Editor } from "./editor";
import { State } from "vanjs-core";
import van from "vanjs-core";
import van, { State } from "vanjs-core";
const openFiles: { [path: string]: OpenFile } = {};
@ -75,16 +74,16 @@ export class OpenFile {
}
dispatch(trs: TransactionSpec, origin?: Editor) {
let transaction = this.rootState.val.update(trs);
const transaction = this.rootState.val.update(trs);
this.rootState.val = transaction.state;
if (origin) {
const es = this.editors.filter((e) => e !== origin);
es.forEach((e) => e.dispatch(e.view.state.update(trs), true));
} else {
this.editors.forEach((e) => {
let changes = transaction.changes;
let userEvent = transaction.annotation(Transaction.userEvent);
let annotations = userEvent
const changes = transaction.changes;
const userEvent = transaction.annotation(Transaction.userEvent);
const annotations = userEvent
? [Transaction.userEvent.of(userEvent)]
: [];
e.dispatch(e.view.state.update({ changes, annotations }), true);