MCPcopy Index your code
hub / github.com/ronreiter/interactive-tutorials / clipLine

Function clipLine

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

Source from the content-addressed store, hash-verified

2277 // SELECTION
2278
2279 function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));}
2280 function clipPos(doc, pos) {
2281 if (pos.line < doc.first) return Pos(doc.first, 0);
2282 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