From 271e24aba2d1315dca6816c07f22847301ca5dc4 Mon Sep 17 00:00:00 2001 From: Jan Jongboom Date: Wed, 2 Nov 2011 09:59:28 +0000 Subject: [PATCH] Issue 489 Initial --- lib/ace/selection.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ace/selection.js b/lib/ace/selection.js index 65e0fec5..5d315a25 100644 --- a/lib/ace/selection.js +++ b/lib/ace/selection.js @@ -440,7 +440,14 @@ var Selection = function(session) { this.selectionLead.row, this.selectionLead.column ); - var screenCol = (chars == 0 && this.$desiredColumn) || screenPos.column; + + var screenCol = (chars === 0 && this.$desiredColumn) || screenPos.column; + + if (this.$lines[screenPos.row].length === screenPos.column && + this.$lines[screenPos.row + rows].match(/^\s*$/)) { + screenCol = this.$lines[screenPos.row + rows].length; + } + var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenCol); this.moveCursorTo(docPos.row, docPos.column + chars, chars == 0); };