MCPcopy
hub / github.com/witheve/Eve / clipLine

Function clipLine

src/codemirror.js:2092–2092  ·  view source on GitHub ↗
(doc, n)

Source from the content-addressed store, hash-verified

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

Callers 2

changeLineFunction · 0.85
codemirror.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected