]> BookStack Code Mirror - bookstack/commitdiff
Added code to set the cursor at end of line while scrolling.
authorAbijeet <redacted>
Sun, 10 Jun 2018 11:34:54 +0000 (17:04 +0530)
committerAbijeet <redacted>
Sun, 10 Jun 2018 11:34:54 +0000 (17:04 +0530)
Signed-off-by: Abijeet <redacted>
resources/assets/js/components/markdown-editor.js

index 4e0ba83baadd4fe3eb18607b90b93caa86e82806..5688ebd61f3203b503ef2766233021368e334f98 100644 (file)
@@ -416,9 +416,13 @@ class MarkdownEditor {
         if (lineNumber !== -1) {
             this.cm.scrollIntoView({
                 line: lineNumber,
-                char: lines[lineNumber].length
             }, 200);
             this.cm.focus();
+            // set the cursor location.
+            this.cm.setCursor({
+                line: lineNumber,
+                char: lines[lineNumber].length
+            })
         }
     }
 
Morty Proxy This is a proxified and sanitized view of the page, visit original site.