set cursor position to end upon switching

This commit is contained in:
celeste 2023-03-14 17:22:18 -07:00
parent 7af61b0a70
commit c20827ee29

View file

@ -461,6 +461,11 @@ export default class LoomPlugin extends Plugin {
);
this.editor.setValue(this.fullText(id, this.state[file.path]));
const lines = this.editor.getValue().split("\n");
const line = lines.length - 1;
const ch = lines[line].length;
this.editor.setCursor({ line, ch });
})
)
);