MCPcopy Index your code
hub / github.com/DHTMLX/gantt / clipLine

Function clipLine

samples/common/codehighlight/codemirror.js:996–996  ·  view source on GitHub ↗
(doc, n)

Source from the content-addressed store, hash-verified

994 // Most of the external API clips given positions to make sure they
995 // actually exist within the document.
996 function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}
997 function clipPos(doc, pos) {
998 if (pos.line < doc.first) { return Pos(doc.first, 0) }
999 var last = doc.first + doc.size - 1;

Callers 2

changeLineFunction · 0.85
addEditorMethodsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected