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

Function visualLineEndNo

external/.scrollLibs.js:1535–1548  ·  view source on GitHub ↗
(doc, lineN)

Source from the content-addressed store, hash-verified

1533 // Get the line number of the start of the next visual line after
1534 // the given line.
1535 function visualLineEndNo(doc, lineN) {
1536 if (lineN > doc.lastLine()) {
1537 return lineN
1538 }
1539 var line = getLine(doc, lineN),
1540 merged
1541 if (!lineIsHidden(doc, line)) {
1542 return lineN
1543 }
1544 while ((merged = collapsedSpanAtEnd(line))) {
1545 line = merged.find(1, true).line
1546 }
1547 return lineNo(line) + 1
1548 }
1549
1550 // Compute whether a line is hidden. Lines count as hidden when they
1551 // are part of a visual line that starts with another line, or when

Callers 2

regChangeFunction · 0.85
updateDisplayIfNeededFunction · 0.85

Calls 5

getLineFunction · 0.85
lineIsHiddenFunction · 0.85
collapsedSpanAtEndFunction · 0.85
lineNoFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected