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

Function attachLocalSpans

external/.scrollLibs.js:6752–6761  ·  view source on GitHub ↗
(doc, change, from, to)

Source from the content-addressed store, hash-verified

6750
6751 // Used to store marked span information in the history.
6752 function attachLocalSpans(doc, change, from, to) {
6753 var existing = change["spans_" + doc.id],
6754 n = 0
6755 doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {
6756 if (line.markedSpans) {
6757 ;(existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans
6758 }
6759 ++n
6760 })
6761 }
6762
6763 // When un/re-doing restores text containing marked spans, those
6764 // that have been explicitly cleared should not be restored.

Callers 1

historyChangeFromChangeFunction · 0.85

Calls 2

maxMethod · 0.80
minMethod · 0.80

Tested by

no test coverage detected