From 9c422423af0a5decb3bb8cf5c26113320409d059 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Fri, 11 Feb 2011 11:41:38 +0100 Subject: [PATCH] fix cursor clipping --- lib/ace/anchor.js | 6 +++--- lib/ace/selection.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ace/anchor.js b/lib/ace/anchor.js index ddaef873..1be42e22 100644 --- a/lib/ace/anchor.js +++ b/lib/ace/anchor.js @@ -135,11 +135,11 @@ var Anchor = exports.Anchor = function(doc, row, column) { this.setPosition = function(row, column) { pos = this.$clipPositionToDocument(row, column); - if (this.row == row && this.column == column) + if (this.row == pos.row && this.column == pos.column) return; - this.row = row; - this.column = column; + this.row = pos.row; + this.column = pos.column; this._dispatchEvent("change"); }; diff --git a/lib/ace/selection.js b/lib/ace/selection.js index e271f0ea..8e6d4b73 100644 --- a/lib/ace/selection.js +++ b/lib/ace/selection.js @@ -406,7 +406,7 @@ var Selection = function(session) { this.moveCursorTo = function(row, column, preventUpdateDesiredColumn) { this.selectionLead.setPosition(row, column); if (!preventUpdateDesiredColumn) - this.$updateDesiredColumn(column); + this.$updateDesiredColumn(this.selectionLead.column); }; }).call(Selection.prototype);