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

Function lineEnd

static/editor.md/lib/codemirror/lib/codemirror.js:8382–8391  ·  view source on GitHub ↗
(cm, lineN)

Source from the content-addressed store, hash-verified

8380 return Pos(lineN, ch);
8381 }
8382 function lineEnd(cm, lineN) {
8383 var merged, line = getLine(cm.doc, lineN);
8384 while (merged = collapsedSpanAtEnd(line)) {
8385 line = merged.find(1, true).line;
8386 lineN = null;
8387 }
8388 var order = getOrder(line);
8389 var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line);
8390 return Pos(lineN == null ? lineNo(line) : lineN, ch);
8391 }
8392 function lineStartSmart(cm, pos) {
8393 var start = lineStart(cm, pos.line);
8394 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