clear selection after text input

This commit is contained in:
Fabian Jakobs 2010-05-03 17:57:56 +02:00
commit 0695b22125
2 changed files with 3 additions and 2 deletions

View file

@ -306,6 +306,8 @@ ace.Editor = function(renderer, doc) {
this.doc.remove(range);
}
this.clearSelection();
var lineState = this.bgTokenizer.getState(cursor.row-1);
var shouldOutdent = this.mode.checkOutdent(lineState, this.doc.getLine(cursor.row), text);

View file

@ -17,7 +17,7 @@ ace.Selection = function(doc) {
ace.implement(this, ace.MEventEmitter);
this.isEmpty = function() {
return (this.selectionAnchor == null ||
return (!this.selectionAnchor ||
(this.selectionAnchor.row == this.selectionLead.row &&
this.selectionAnchor.column == this.selectionLead.column));
};
@ -37,7 +37,6 @@ ace.Selection = function(doc) {
this.setSelectionAnchor = function(row, column) {
this.clearSelection();
this.selectionAnchor = this.$clipPositionToDocument(row, column);
};