This commit is contained in:
nightwing 2012-03-26 22:37:23 +04:00
commit 98180d5b07
5 changed files with 770 additions and 492 deletions

View file

@ -66,7 +66,7 @@ var Cursor = function(parentEl) {
this.addCursor = function() {
var el = dom.createElement("div");
var className = "ace_cursor"
var className = "ace_cursor";
if (!this.isVisible)
className += " ace_hidden";
if (this.overwrite)
@ -81,8 +81,8 @@ var Cursor = function(parentEl) {
this.removeCursor = function() {
if (this.cursors.length > 1) {
var el = this.cursors.pop();
el.parentNode.removeChild(el)
return el
el.parentNode.removeChild(el);
return el;
}
};
@ -141,8 +141,8 @@ var Cursor = function(parentEl) {
this.update = function(config) {
this.config = config;
if (this.session.selection.rangeCount > 1) {
var selections = this.session.selection.getAllRanges();
if (this.session.selectionMarkerCount > 1) {
var selections = this.session.$selectionMarkers;
var i = 0, sel, cursorIndex = 0;
for (var i = selections.length; i--; ) {
@ -156,8 +156,8 @@ var Cursor = function(parentEl) {
style.width = config.characterWidth + "px";
style.height = config.lineHeight + "px";
}
if (this.cursors.length > 1)
while (cursorIndex < this.cursors.length)
if (cursorIndex > 1)
while (this.cursors.length > cursorIndex)
this.removeCursor();
} else {
var pixelPos = this.getPixelPosition(null, true);