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

Function clipToLen

samples/common/codehighlight/codemirror.js:1003–1008  ·  view source on GitHub ↗
(pos, linelen)

Source from the content-addressed store, hash-verified

1001 return clipToLen(pos, getLine(doc, pos.line).text.length)
1002 }
1003 function clipToLen(pos, linelen) {
1004 var ch = pos.ch;
1005 if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }
1006 else if (ch < 0) { return Pos(pos.line, 0) }
1007 else { return pos }
1008 }
1009 function clipPosArray(doc, array) {
1010 var out = [];
1011 for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }

Callers 1

clipPosFunction · 0.85

Calls 1

PosFunction · 0.85

Tested by

no test coverage detected