MCPcopy Create free account
hub / github.com/feiyu563/PrometheusAlert / attachDoc

Function attachDoc

static/plugins/codemirror/codemirror.js:4823–4834  ·  view source on GitHub ↗
(cm, doc)

Source from the content-addressed store, hash-verified

4821
4822 // Attach a document to an editor.
4823 function attachDoc(cm, doc) {
4824 if (doc.cm) { throw new Error("This document is already in use.") }
4825 cm.doc = doc;
4826 doc.cm = cm;
4827 estimateLineHeights(cm);
4828 loadMode(cm);
4829 setDirectionClass(cm);
4830 cm.options.direction = doc.direction;
4831 if (!cm.options.lineWrapping) { findMaxLine(cm); }
4832 cm.options.mode = doc.modeOption;
4833 regChange(cm);
4834 }
4835
4836 function setDirectionClass(cm) {
4837 (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