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

Function linkedDocs

external/.scrollLibs.js:6557–6575  ·  view source on GitHub ↗
(doc, f, sharedHistOnly)

Source from the content-addressed store, hash-verified

6555
6556 // Call f for all linked documents.
6557 function linkedDocs(doc, f, sharedHistOnly) {
6558 function propagate(doc, skip, sharedHist) {
6559 if (doc.linked) {
6560 for (var i = 0; i < doc.linked.length; ++i) {
6561 var rel = doc.linked[i]
6562 if (rel.doc == skip) {
6563 continue
6564 }
6565 var shared = sharedHist && rel.sharedHist
6566 if (sharedHistOnly && !shared) {
6567 continue
6568 }
6569 f(rel.doc, shared)
6570 propagate(rel.doc, doc, shared)
6571 }
6572 }
6573 }
6574 propagate(doc, null, true)
6575 }
6576
6577 // Attach a document to an editor.
6578 function attachDoc(cm, doc) {

Callers 5

historyChangeFromChangeFunction · 0.85
makeChangeInnerFunction · 0.85
loopFunction · 0.85
markTextSharedFunction · 0.85
.scrollLibs.jsFile · 0.85

Calls 1

propagateFunction · 0.85

Tested by

no test coverage detected