diff --git a/lib/ace/layer/cursor.js b/lib/ace/layer/cursor.js index c2a7ca28..bf6c2901 100644 --- a/lib/ace/layer/cursor.js +++ b/lib/ace/layer/cursor.js @@ -142,7 +142,7 @@ var Cursor = function(parentEl) { this.config = config; if (this.session.selection.rangeCount > 1) { - var selections = this.session.selection.allRanges + var selections = this.session.selection.getAllRanges(); var i = 0, sel, cursorIndex = 0; for (var i = selections.length; i--; ) { @@ -156,8 +156,9 @@ var Cursor = function(parentEl) { style.width = config.characterWidth + "px"; style.height = config.lineHeight + "px"; } - while (cursorIndex < this.cursors.length) - this.removeCursor(); + if (this.cursors.length > 1) + while (cursorIndex < this.cursors.length) + this.removeCursor(); } else { var pixelPos = this.getPixelPosition(null, true); var style = this.cursor.style;