Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix Bug 365311: Styles were not sent for lines whose styling became e…
  • Loading branch information
Mark Macdonald committed Dec 2, 2011
1 parent 293799c commit 5ae4f09
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions lib/highlighter.js
Expand Up @@ -332,32 +332,33 @@ define(["CodeMirror", "orion/textview/eventTarget"], function(mMirror, mEventTar
sendStyle: function() {
var start = this.redrawStart, end = this.redrawEnd;
if (start < Number.MAX_VALUE && end > -1) {
var style = {}, isStyleChange = false;
var style = {};
for (var i=start; i <= end; i++) {
var lineIndex = i, line = this.lines[lineIndex];
var rangesErrors = line && this.styleToRangesErrors(line.style);
if (rangesErrors) {
var ranges = rangesErrors[0], errors = rangesErrors[1];
var obj = {};
var obj = {}, hasAnything = false;
if (ranges && ranges.length) {
obj.ranges = ranges;
isStyleChange = true;
style[i] = obj;
hasAnything = true;
}
if (errors && errors.length) {
obj.errors = errors;
isStyleChange = true;
style[i] = obj;
hasAnything = true;
}
if (!hasAnything) {
style[i] = null;
}
}
}
if (isStyleChange) {
var event = {
type: "StyleReady",
style: style
};
this.dispatchEvent(event);
}
var event = {
type: "StyleReady",
style: style
};
this.dispatchEvent(event);
}
//console.debug("Fired " + (end - start) + " lines [" + start + ".." + end + "]");
this.redrawStart = Number.MAX_VALUE;
Expand Down

0 comments on commit 5ae4f09

Please sign in to comment.