diff --git a/Editor.js b/Editor.js index e7727874..9162f191 100644 --- a/Editor.js +++ b/Editor.js @@ -168,6 +168,7 @@ function Editor(doc, renderer) addListener(container, "mousedown", function(e) { textInput.focus(); self.placeCursorToMouse(e.pageX, e.pageY); + self.renderer.scrollCursorIntoView(); return preventDefault(e); }); diff --git a/VirtualRenderer.js b/VirtualRenderer.js index fd5908bb..412a969b 100644 --- a/VirtualRenderer.js +++ b/VirtualRenderer.js @@ -1,6 +1,7 @@ function VirtualRenderer(containerId) { DumbRenderer.call(this, containerId); + this.scrollTop = 0; this.firstRow = 0; @@ -24,6 +25,7 @@ function VirtualRenderer(containerId) update: this.updateMarkers }); } + inherits(VirtualRenderer, DumbRenderer); VirtualRenderer.prototype.draw = function() diff --git a/editor.html b/editor.html index 7e83e551..0f8b8d4c 100644 --- a/editor.html +++ b/editor.html @@ -44,7 +44,8 @@ font-size: 14px; white-space: nowrap; -webkit-box-sizing: border-box; - box-sizing: border-box; + box-sizing: border-box; + cursor: text; } .composition { @@ -105,10 +106,8 @@