MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / findMaxLine

Function findMaxLine

lib/web/CodeMirror/src/line/spans.js:370–382  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

368
369// Find the longest line in the document.
370export function findMaxLine(cm) {
371 let d = cm.display, doc = cm.doc
372 d.maxLine = getLine(doc, doc.first)
373 d.maxLineLength = lineLength(d.maxLine)
374 d.maxLineChanged = true
375 doc.iter(line => {
376 let len = lineLength(line)
377 if (len > d.maxLineLength) {
378 d.maxLineLength = len
379 d.maxLine = line
380 }
381 })
382}

Callers 3

endOperation_R1Function · 0.90
attachDocFunction · 0.90
wrappingChangedFunction · 0.90

Calls 2

getLineFunction · 0.90
lineLengthFunction · 0.70

Tested by

no test coverage detected