1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2026-03-11 13:41:43 +00:00

insertText() CM5 -> CM6

This commit is contained in:
Fred Sauer
2026-02-18 17:35:39 -08:00
parent 7c7de905ca
commit 81464015ac

View File

@@ -299,8 +299,12 @@ export class SourceEditor implements ProjectView {
}
insertText(text: string) {
var cur = this.editor.getCursor();
this.editor.replaceRange(text, cur, cur);
const main = this.editor.state.selection.main;
this.editor.dispatch({
changes: { from: main.from, to: main.to, insert: text },
selection: { anchor: main.from + text.length },
userEvent: "input.paste"
});
}
highlightLines(start: number, end: number) {