MCPcopy
hub / github.com/witheve/Eve / lineLength

Function lineLength

src/codemirror.js:336–352  ·  view source on GitHub ↗
(line)

Source from the content-addressed store, hash-verified

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

Callers 11

findMaxLineFunction · 0.85
codemirror.jsFile · 0.85
VimFunction · 0.85
clipCursorToContentFunction · 0.85
extendLineToColumnFunction · 0.85
getLastSelectedAreaRangeFunction · 0.85
expandSelectionFunction · 0.85
makeCmSelectionFunction · 0.85
clipToLineFunction · 0.85
moveToWordFunction · 0.85

Calls 4

collapsedSpanAtStartFunction · 0.85
collapsedSpanAtEndFunction · 0.85
getLineMethod · 0.80
findMethod · 0.65

Tested by

no test coverage detected