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

Function findMaxLine

static/editor.md/lib/codemirror/lib/codemirror.js:348–360  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

346
347 // Find the longest line in the document.
348 function findMaxLine(cm) {
349 var d = cm.display, doc = cm.doc;
350 d.maxLine = getLine(doc, doc.first);
351 d.maxLineLength = lineLength(d.maxLine);
352 d.maxLineChanged = true;
353 doc.iter(function(line) {
354 var len = lineLength(line);
355 if (len > d.maxLineLength) {
356 d.maxLineLength = len;
357 d.maxLine = line;
358 }
359 });
360 }
361
362 // Make sure the gutters options contains the element
363 // "CodeMirror-linenumbers" when the lineNumbers option is true.

Callers 3

wrappingChangedFunction · 0.70
endOperation_R1Function · 0.70
attachDocFunction · 0.70

Calls 2

getLineFunction · 0.70
lineLengthFunction · 0.70

Tested by

no test coverage detected