MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / attachLocalSpans

Function attachLocalSpans

static/js/codemirror/codemirror.js:4665–4672  ·  view source on GitHub ↗
(doc, change, from, to)

Source from the content-addressed store, hash-verified

4663 }
4664
4665 function attachLocalSpans(doc, change, from, to) {
4666 var existing = change["spans_" + doc.id], n = 0;
4667 doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) {
4668 if (line.markedSpans)
4669 (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans;
4670 ++n;
4671 });
4672 }
4673
4674 function historyChangeFromChange(doc, change) {
4675 var histChange = {from: change.from, to: changeEnd(change), text: getBetween(doc, change.from, change.to)};

Callers 1

historyChangeFromChangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected