MCPcopy Index your code
hub / github.com/DHTMLX/gantt / attachDoc

Function attachDoc

samples/common/codehighlight/codemirror.js:4781–4791  ·  view source on GitHub ↗
(cm, doc)

Source from the content-addressed store, hash-verified

4779
4780 // Attach a document to an editor.
4781 function attachDoc(cm, doc) {
4782 if (doc.cm) { throw new Error("This document is already in use.") }
4783 cm.doc = doc;
4784 doc.cm = cm;
4785 estimateLineHeights(cm);
4786 loadMode(cm);
4787 setDirectionClass(cm);
4788 if (!cm.options.lineWrapping) { findMaxLine(cm); }
4789 cm.options.mode = doc.modeOption;
4790 regChange(cm);
4791 }
4792
4793 function setDirectionClass(cm) {
4794 (cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl");

Callers 2

CodeMirrorFunction · 0.85
addEditorMethodsFunction · 0.85

Calls 5

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

Tested by

no test coverage detected