MCPcopy
hub / github.com/csev/py4e / copyStyles

Function copyStyles

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:2783–2796  ·  view source on GitHub ↗
(from, to, source, dest)

Source from the content-addressed store, hash-verified

2781 };
2782 // Utility used by replace and split above
2783 function copyStyles(from, to, source, dest) {
2784 for (var i = 0, pos = 0, state = 0; pos < to; i+=2) {
2785 var part = source[i], end = pos + part.length;
2786 if (state == 0) {
2787 if (end > from) dest.push(part.slice(from - pos, Math.min(part.length, to - pos)), source[i+1]);
2788 if (end >= from) state = 1;
2789 }
2790 else if (state == 1) {
2791 if (end > to) dest.push(part.slice(0, to - pos), source[i+1]);
2792 else dest.push(part, source[i+1]);
2793 }
2794 pos = end;
2795 }
2796 }
2797
2798 // Data structure that holds the sequence of lines.
2799 function LeafChunk(lines) {

Callers 1

codemirrorepl.jsFile · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected