MCPcopy Create free account
hub / github.com/TruthHun/BookStack / attachDoc

Function attachDoc

static/mergely/lib/codemirror.js:7747–7756  ·  view source on GitHub ↗
(cm, doc)

Source from the content-addressed store, hash-verified

7745
7746 // Attach a document to an editor.
7747 function attachDoc(cm, doc) {
7748 if (doc.cm) throw new Error("This document is already in use.");
7749 cm.doc = doc;
7750 doc.cm = cm;
7751 estimateLineHeights(cm);
7752 loadMode(cm);
7753 if (!cm.options.lineWrapping) findMaxLine(cm);
7754 cm.options.mode = doc.modeOption;
7755 regChange(cm);
7756 }
7757
7758 // LINE UTILITIES
7759

Callers 2

CodeMirrorFunction · 0.70
codemirror.jsFile · 0.70

Calls 4

estimateLineHeightsFunction · 0.70
loadModeFunction · 0.70
findMaxLineFunction · 0.70
regChangeFunction · 0.70

Tested by

no test coverage detected