MCPcopy Create free account
hub / github.com/sql-js/sql.js / clipLine

Function clipLine

GUI/codemirror/lib/codemirror.js:1034–1034  ·  view source on GitHub ↗
(doc, n)

Source from the content-addressed store, hash-verified

1032 // Most of the external API clips given positions to make sure they
1033 // actually exist within the document.
1034 function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));}
1035 function clipPos(doc, pos) {
1036 if (pos.line < doc.first) return Pos(doc.first, 0);
1037 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…