better handling of multiple cursors

This commit is contained in:
nightwing 2012-03-22 19:38:31 +04:00
commit 580ed00afa

View file

@ -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;