MCPcopy Create free account
hub / github.com/TruthHun/BookStack / lineEnd

Function lineEnd

static/mergely/lib/codemirror.js:8625–8634  ·  view source on GitHub ↗
(cm, lineN)

Source from the content-addressed store, hash-verified

8623 return Pos(lineN, ch);
8624 }
8625 function lineEnd(cm, lineN) {
8626 var merged, line = getLine(cm.doc, lineN);
8627 while (merged = collapsedSpanAtEnd(line)) {
8628 line = merged.find(1, true).line;
8629 lineN = null;
8630 }
8631 var order = getOrder(line);
8632 var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line);
8633 return Pos(lineN == null ? lineNo(line) : lineN, ch);
8634 }
8635 function lineStartSmart(cm, pos) {
8636 var start = lineStart(cm, pos.line);
8637 var line = getLine(cm.doc, start.line);

Callers 1

codemirror.jsFile · 0.70

Calls 6

getLineFunction · 0.70
collapsedSpanAtEndFunction · 0.70
getOrderFunction · 0.70
lineLeftFunction · 0.70
lineRightFunction · 0.70
lineNoFunction · 0.70

Tested by

no test coverage detected