MCPcopy Index your code
hub / github.com/DHTMLX/gantt / retreatFrontier

Function retreatFrontier

samples/common/codehighlight/codemirror.js:1272–1287  ·  view source on GitHub ↗
(doc, n)

Source from the content-addressed store, hash-verified

1270 }
1271
1272 function retreatFrontier(doc, n) {
1273 doc.modeFrontier = Math.min(doc.modeFrontier, n);
1274 if (doc.highlightFrontier < n - 10) { return }
1275 var start = doc.first;
1276 for (var line = n - 1; line > start; line--) {
1277 var saved = getLine(doc, line).stateAfter;
1278 // change is on 3
1279 // state on line 1 looked ahead 2 -- so saw 3
1280 // test 1 + 2 < 3 should cover this
1281 if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {
1282 start = line + 1;
1283 break
1284 }
1285 }
1286 doc.highlightFrontier = Math.min(doc.highlightFrontier, start);
1287 }
1288
1289 // Optimize some code when these features are not used.
1290 var sawReadOnlySpans = false, sawCollapsedSpans = false;

Callers 1

Calls 1

getLineFunction · 0.85

Tested by

no test coverage detected