(doc, f, sharedHistOnly)
| 4764 | |
| 4765 | // Call f for all linked documents. |
| 4766 | function linkedDocs(doc, f, sharedHistOnly) { |
| 4767 | function propagate(doc, skip, sharedHist) { |
| 4768 | if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) { |
| 4769 | var rel = doc.linked[i]; |
| 4770 | if (rel.doc == skip) { continue } |
| 4771 | var shared = sharedHist && rel.sharedHist; |
| 4772 | if (sharedHistOnly && !shared) { continue } |
| 4773 | f(rel.doc, shared); |
| 4774 | propagate(rel.doc, doc, shared); |
| 4775 | } } |
| 4776 | } |
| 4777 | propagate(doc, null, true); |
| 4778 | } |
| 4779 | |
| 4780 | // Attach a document to an editor. |
| 4781 | function attachDoc(cm, doc) { |
no test coverage detected