rewriting bound function doesn't work
This commit is contained in:
parent
25400848f2
commit
e24dab2ea1
1 changed files with 8 additions and 29 deletions
|
|
@ -48,19 +48,13 @@ var FoldMode = exports.FoldMode = function() {};
|
||||||
|
|
||||||
// must return "" if there's no fold, to enable caching
|
// must return "" if there's no fold, to enable caching
|
||||||
this.getFoldWidget = function(session, foldStyle, row) {
|
this.getFoldWidget = function(session, foldStyle, row) {
|
||||||
if (this.foldingStartMarker) {
|
var line = session.getLine(row);
|
||||||
if (this.foldingStopMarker) {
|
if (this.foldingStartMarker.test(line))
|
||||||
// rewrite getFoldWidget so the check is only performed once
|
return "start";
|
||||||
FoldMode.prototype.getFoldWidget = this.$testBoth;
|
if (foldStyle == "markbeginend"
|
||||||
return this.$testBoth(session, foldStyle, row);
|
&& this.foldingStopMarker
|
||||||
}
|
&& this.foldingStopMarker.test(line))
|
||||||
else {
|
return "end";
|
||||||
// rewrite getFoldWidget so the check is only performed once
|
|
||||||
FoldMode.prototype.getFoldWidget = this.$testStart;
|
|
||||||
return this.$testStart(session, foldStyle, row);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return "";
|
return "";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -113,21 +107,6 @@ var FoldMode = exports.FoldMode = function() {};
|
||||||
return Range.fromPoints(start, end);
|
return Range.fromPoints(start, end);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$testStart = function(session, foldStyle, row) {
|
|
||||||
if (this.foldingStartMarker.test(session.getLine(row)))
|
|
||||||
return "start";
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$testBoth = function(session, foldStyle, row) {
|
|
||||||
var line = session.getLine(row);
|
|
||||||
if (this.foldingStartMarker.test(line))
|
|
||||||
return "start";
|
|
||||||
if (foldStyle == "markbeginend" && this.foldingStopMarker.test(line))
|
|
||||||
return "end";
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
}).call(FoldMode.prototype);
|
}).call(FoldMode.prototype);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue