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

Function clipLine

static/mergely/lib/codemirror.js:2087–2087  ·  view source on GitHub ↗
(doc, n)

Source from the content-addressed store, hash-verified

2085 // Most of the external API clips given positions to make sure they
2086 // actually exist within the document.
2087 function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));}
2088 function clipPos(doc, pos) {
2089 if (pos.line < doc.first) return Pos(doc.first, 0);
2090 var last = doc.first + doc.size - 1;

Callers 2

changeLineFunction · 0.70
codemirror.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected