MCPcopy Create free account
hub / github.com/sql-js/sql.js / attachLocalSpans

Function attachLocalSpans

GUI/codemirror/lib/codemirror.js:6720–6727  ·  view source on GitHub ↗
(doc, change, from, to)

Source from the content-addressed store, hash-verified

6718
6719 // Used to store marked span information in the history.
6720 function attachLocalSpans(doc, change, from, to) {
6721 var existing = change["spans_" + doc.id], n = 0;
6722 doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) {
6723 if (line.markedSpans)
6724 (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans;
6725 ++n;
6726 });
6727 }
6728
6729 // When un/re-doing restores text containing marked spans, those
6730 // that have been explicitly cleared should not be restored.

Callers 1

historyChangeFromChangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…