MCPcopy Create free account
hub / github.com/breck7/scroll / lineLength

Function lineLength

external/.scrollLibs.js:1619–1639  ·  view source on GitHub ↗
(line)

Source from the content-addressed store, hash-verified

1617 // collapsed ranges (see markText) that might hide parts, and join
1618 // other lines onto it.
1619 function lineLength(line) {
1620 if (line.height == 0) {
1621 return 0
1622 }
1623 var len = line.text.length,
1624 merged,
1625 cur = line
1626 while ((merged = collapsedSpanAtStart(cur))) {
1627 var found = merged.find(0, true)
1628 cur = found.from.line
1629 len += found.from.ch - found.to.ch
1630 }
1631 cur = line
1632 while ((merged = collapsedSpanAtEnd(cur))) {
1633 var found$1 = merged.find(0, true)
1634 len -= cur.text.length - found$1.from.ch
1635 cur = found$1.to.line
1636 len += cur.text.length - found$1.to.ch
1637 }
1638 return len
1639 }
1640
1641 // Find the longest line in the document.
1642 function findMaxLine(cm) {

Callers 3

findMaxLineFunction · 0.85
.scrollLibs.jsFile · 0.85

Calls 3

collapsedSpanAtStartFunction · 0.85
collapsedSpanAtEndFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected