Improve performance of drawing bugpath
@@ -175,6 +175,7 @@ function (declare, domClass, dom, style, fx, Toggler, on, query, Memory,
addBubbles : function (bubbles) {
var that = this;
+ that.codeMirror.operation(function () {
bubbles.forEach(function (bubble, i) {
var isResult = i === bubbles.length - 1;
@@ -195,13 +196,15 @@ function (declare, domClass, dom, style, fx, Toggler, on, query, Memory,
that._lineWidgets.push(that.codeMirror.addLineWidget(
bubble.startLine - 1, element));
});
+ });
},
addOtherFileBubbles : function (path) {
var that = this;
+ that.codeMirror.operation(function () {
for (var i = 1; i < path.length; ++i) {
- if (path[i].fileId !== this.sourceFileData.fileId &&
+ if (path[i].fileId !== that.sourceFileData.fileId &&
path[i].fileId !== path[i - 1].fileId) {
var element = dom.create('div', {
class : 'otherFileMsg',
@@ -217,10 +220,11 @@ function (declare, domClass, dom, style, fx, Toggler, on, query, Memory,
})(i)
});
- this._lineWidgets.push(this.codeMirror.addLineWidget(
+ that._lineWidgets.push(that.codeMirror.addLineWidget(
path[i - 1].startLine - 1, element));
}
}
+ });
},
clearBubbles : function () {
@@ -231,12 +235,14 @@ function (declare, domClass, dom, style, fx, Toggler, on, query, Memory,
addLines : function (points) {
var that = this;
+ that.codeMirror.operation(function () {
points.forEach(function (p, i) {
that._lineMarks.push(that.codeMirror.doc.markText(
{ line : p.startLine - 1, ch : p.startCol + 1 },
{ line : p.endLine - 1, ch : p.endCol },
{ className : 'checkerstep' }));
});
+ });
var range = this.codeMirror.getViewport();
this._lineDrawer(range.from, range.to);
