From c20827ee29dbde2d79ce1e261ebfd8f1b9705330 Mon Sep 17 00:00:00 2001 From: celeste Date: Tue, 14 Mar 2023 17:22:18 -0700 Subject: [PATCH] set cursor position to end upon switching --- main.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.ts b/main.ts index db13912..25fa589 100644 --- a/main.ts +++ b/main.ts @@ -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 }); }) ) );