(doc, f, sharedHistOnly)
| 6397 | |
| 6398 | // Call f for all linked documents. |
| 6399 | function linkedDocs(doc, f, sharedHistOnly) { |
| 6400 | function propagate(doc, skip, sharedHist) { |
| 6401 | if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) { |
| 6402 | var rel = doc.linked[i]; |
| 6403 | if (rel.doc == skip) continue; |
| 6404 | var shared = sharedHist && rel.sharedHist; |
| 6405 | if (sharedHistOnly && !shared) continue; |
| 6406 | f(rel.doc, shared); |
| 6407 | propagate(rel.doc, doc, shared); |
| 6408 | } |
| 6409 | } |
| 6410 | propagate(doc, null, true); |
| 6411 | } |
| 6412 | |
| 6413 | // Attach a document to an editor. |
| 6414 | function attachDoc(cm, doc) { |
no test coverage detected