From: Abijeet Date: Sun, 10 Jun 2018 11:34:54 +0000 (+0530) Subject: Added code to set the cursor at end of line while scrolling. X-Git-Tag: v0.23.0~1^2~16 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/562225a77b1cde623bad3f51f12fc26bef38402a Added code to set the cursor at end of line while scrolling. Signed-off-by: Abijeet --- diff --git a/resources/assets/js/components/markdown-editor.js b/resources/assets/js/components/markdown-editor.js index 4e0ba83ba..5688ebd61 100644 --- a/resources/assets/js/components/markdown-editor.js +++ b/resources/assets/js/components/markdown-editor.js @@ -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 + }) } }