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

Function attachDoc

static/editor.md/lib/codemirror/lib/codemirror.js:7516–7525  ·  view source on GitHub ↗
(cm, doc)

Source from the content-addressed store, hash-verified

7514
7515 // Attach a document to an editor.
7516 function attachDoc(cm, doc) {
7517 if (doc.cm) throw new Error("This document is already in use.");
7518 cm.doc = doc;
7519 doc.cm = cm;
7520 estimateLineHeights(cm);
7521 loadMode(cm);
7522 if (!cm.options.lineWrapping) findMaxLine(cm);
7523 cm.options.mode = doc.modeOption;
7524 regChange(cm);
7525 }
7526
7527 // LINE UTILITIES
7528

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