MCPcopy Index your code
hub / github.com/ronreiter/interactive-tutorials / computeMaxLength

Function computeMaxLength

static/js/codemirror/codemirror.js:288–300  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

286 }
287
288 function computeMaxLength(cm) {
289 var d = cm.display, doc = cm.doc;
290 d.maxLine = getLine(doc, doc.first);
291 d.maxLineLength = lineLength(doc, d.maxLine);
292 d.maxLineChanged = true;
293 doc.iter(function(line) {
294 var len = lineLength(doc, line);
295 if (len > d.maxLineLength) {
296 d.maxLineLength = len;
297 d.maxLine = line;
298 }
299 });
300 }
301
302 // Make sure the gutters options contains the element
303 // "CodeMirror-linenumbers" when the lineNumbers option is true.

Callers 3

wrappingChangedFunction · 0.85
endOperationFunction · 0.85
attachDocFunction · 0.85

Calls 2

getLineFunction · 0.85
lineLengthFunction · 0.70

Tested by

no test coverage detected