MCPcopy Create free account
hub / github.com/breck7/scroll / loop

Function loop

external/.scrollLibs.js:2498–2538  ·  view source on GitHub ↗
(o)

Source from the content-addressed store, hash-verified

2496
2497 // Run overlays, adjust style array.
2498 var loop = function (o) {
2499 context.baseTokens = st
2500 var overlay = cm.state.overlays[o],
2501 i = 1,
2502 at = 0
2503 context.state = true
2504 runMode(
2505 cm,
2506 line.text,
2507 overlay.mode,
2508 context,
2509 function (end, style) {
2510 var start = i
2511 // Ensure there's a token end at the current position, and that i points at it
2512 while (at < end) {
2513 var i_end = st[i]
2514 if (i_end > end) {
2515 st.splice(i, 1, end, st[i + 1], i_end)
2516 }
2517 i += 2
2518 at = Math.min(end, i_end)
2519 }
2520 if (!style) {
2521 return
2522 }
2523 if (overlay.opaque) {
2524 st.splice(start, i - start, end, "overlay " + style)
2525 i = start + 2
2526 } else {
2527 for (; start < i; start += 2) {
2528 var cur = st[start + 1]
2529 st[start + 1] = (cur ? cur + " " : "") + "overlay " + style
2530 }
2531 }
2532 },
2533 lineClasses
2534 )
2535 context.state = state
2536 context.baseTokens = null
2537 context.baseTokenPos = 1
2538 }
2539
2540 for (var o = 0; o < cm.state.overlays.length; ++o) loop(o)
2541

Callers 4

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

Calls 12

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
minMethod · 0.80

Tested by

no test coverage detected