MCPcopy Index your code
hub / github.com/csev/py4e / lineLength

Function lineLength

tools/pythonauto/static/codemirrorepl/codemirror.js:343–359  ·  view source on GitHub ↗
(line)

Source from the content-addressed store, hash-verified

341 // collapsed ranges (see markText) that might hide parts, and join
342 // other lines onto it.
343 function lineLength(line) {
344 if (line.height == 0) return 0;
345 var len = line.text.length, merged, cur = line;
346 while (merged = collapsedSpanAtStart(cur)) {
347 var found = merged.find(0, true);
348 cur = found.from.line;
349 len += found.from.ch - found.to.ch;
350 }
351 cur = line;
352 while (merged = collapsedSpanAtEnd(cur)) {
353 var found = merged.find(0, true);
354 len -= cur.text.length - found.from.ch;
355 cur = found.to.line;
356 len += cur.text.length - found.to.ch;
357 }
358 return len;
359 }
360
361 // Find the longest line in the document.
362 function findMaxLine(cm) {

Callers 3

findMaxLineFunction · 0.70
codemirror.jsFile · 0.70

Calls 3

collapsedSpanAtStartFunction · 0.70
collapsedSpanAtEndFunction · 0.70
findMethod · 0.45

Tested by

no test coverage detected