MCPcopy Create free account
hub / github.com/TextGeneratorio/text-generator.io / loop

Function loop

static/libs/codemirror.js:1544–1572  ·  view source on GitHub ↗
( o )

Source from the content-addressed store, hash-verified

1542
1543 // Run overlays, adjust style array.
1544 var loop = function ( o ) {
1545 context.baseTokens = st;
1546 var overlay = cm.state.overlays[o], i = 1, at = 0;
1547 context.state = true;
1548 runMode(cm, line.text, overlay.mode, context, function (end, style) {
1549 var start = i;
1550 // Ensure there's a token end at the current position, and that i points at it
1551 while (at < end) {
1552 var i_end = st[i];
1553 if (i_end > end)
1554 { st.splice(i, 1, end, st[i+1], i_end); }
1555 i += 2;
1556 at = Math.min(end, i_end);
1557 }
1558 if (!style) { return }
1559 if (overlay.opaque) {
1560 st.splice(start, i - start, end, "overlay " + style);
1561 i = start + 2;
1562 } else {
1563 for (; start < i; start += 2) {
1564 var cur = st[start+1];
1565 st[start+1] = (cur ? cur + " " : "") + "overlay " + style;
1566 }
1567 }
1568 }, lineClasses);
1569 context.state = state;
1570 context.baseTokens = null;
1571 context.baseTokenPos = 1;
1572 };
1573
1574 for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );
1575

Callers 4

highlightLineFunction · 0.85
signalLaterFunction · 0.85
makeChangeFromHistoryFunction · 0.85
detachSharedMarkersFunction · 0.85

Calls 11

runModeFunction · 0.85
filterChangeFunction · 0.85
historyChangeFromChangeFunction · 0.85
computeSelAfterChangeFunction · 0.85
lstFunction · 0.85
makeChangeSingleDocFunction · 0.85
mergeOldSpansFunction · 0.85
changeEndFunction · 0.85
linkedDocsFunction · 0.85
indexOfFunction · 0.85
rebaseHistFunction · 0.85

Tested by

no test coverage detected