fix line highlight on the last line

Issue #934
This commit is contained in:
nightwing 2012-10-01 17:12:42 +04:00
commit dfe918e339
2 changed files with 39 additions and 26 deletions

View file

@ -375,14 +375,7 @@ var EditSession = function(text, mode) {
token.start = c - token.value.length;
return token;
};
this.highlight = function(re) {
if (!this.$searchHighlight) {
var highlight = new SearchHighlight(null, "ace_selected-word", "text");
this.$searchHighlight = this.addDynamicMarker(highlight);
}
this.$searchHighlight.setRegexp(re);
}
/**
* EditSession.setUndoManager(undoManager)
* - undoManager (UndoManager): The new undo manager
@ -736,6 +729,30 @@ var EditSession = function(text, mode) {
return inFront ? this.$frontMarkers : this.$backMarkers;
};
this.highlight = function(re) {
if (!this.$searchHighlight) {
var highlight = new SearchHighlight(null, "ace_selected-word", "text");
this.$searchHighlight = this.addDynamicMarker(highlight);
}
this.$searchHighlight.setRegexp(re);
}
// experimental
this.highlightLines = function(startRow, endRow, clazz, inFront) {
if (typeof endRow != "number") {
clazz = endRow;
endRow = startRow;
}
if (!clazz)
clazz = "ace_step";
var range = new Range(startRow, 0, endRow, Infinity);
var id = this.addMarker(range, clazz, "fullLine", inFront);
range.id = id;
return range;
},
/*
* Error:
* {