MCPcopy Create free account
hub / github.com/sql-js/sql.js / attachDoc

Function attachDoc

GUI/codemirror/lib/codemirror.js:6464–6473  ·  view source on GitHub ↗
(cm, doc)

Source from the content-addressed store, hash-verified

6462
6463 // Attach a document to an editor.
6464 function attachDoc(cm, doc) {
6465 if (doc.cm) throw new Error("This document is already in use.");
6466 cm.doc = doc;
6467 doc.cm = cm;
6468 estimateLineHeights(cm);
6469 loadMode(cm);
6470 if (!cm.options.lineWrapping) findMaxLine(cm);
6471 cm.options.mode = doc.modeOption;
6472 regChange(cm);
6473 }
6474
6475 // LINE UTILITIES
6476

Callers 2

CodeMirrorFunction · 0.85
codemirror.jsFile · 0.85

Calls 4

estimateLineHeightsFunction · 0.85
loadModeFunction · 0.85
findMaxLineFunction · 0.85
regChangeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…