better handling of multiple cursors
This commit is contained in:
parent
c2e1f8815d
commit
580ed00afa
1 changed files with 4 additions and 3 deletions
|
|
@ -142,7 +142,7 @@ var Cursor = function(parentEl) {
|
||||||
this.config = config;
|
this.config = config;
|
||||||
|
|
||||||
if (this.session.selection.rangeCount > 1) {
|
if (this.session.selection.rangeCount > 1) {
|
||||||
var selections = this.session.selection.allRanges
|
var selections = this.session.selection.getAllRanges();
|
||||||
var i = 0, sel, cursorIndex = 0;
|
var i = 0, sel, cursorIndex = 0;
|
||||||
|
|
||||||
for (var i = selections.length; i--; ) {
|
for (var i = selections.length; i--; ) {
|
||||||
|
|
@ -156,8 +156,9 @@ var Cursor = function(parentEl) {
|
||||||
style.width = config.characterWidth + "px";
|
style.width = config.characterWidth + "px";
|
||||||
style.height = config.lineHeight + "px";
|
style.height = config.lineHeight + "px";
|
||||||
}
|
}
|
||||||
while (cursorIndex < this.cursors.length)
|
if (this.cursors.length > 1)
|
||||||
this.removeCursor();
|
while (cursorIndex < this.cursors.length)
|
||||||
|
this.removeCursor();
|
||||||
} else {
|
} else {
|
||||||
var pixelPos = this.getPixelPosition(null, true);
|
var pixelPos = this.getPixelPosition(null, true);
|
||||||
var style = this.cursor.style;
|
var style = this.cursor.style;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue