MCPcopy Index your code
hub / github.com/csev/py4e / clipLine

Function clipLine

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:1439–1439  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

1437 }
1438
1439 function clipLine(n) {return Math.max(0, Math.min(n, doc.size-1));}
1440 function clipPos(pos) {
1441 if (pos.line < 0) return {line: 0, ch: 0};
1442 if (pos.line >= doc.size) return {line: doc.size-1, ch: getLine(doc.size-1).text.length};

Callers 4

CodeMirrorFunction · 0.70
addGutterMarkerFunction · 0.70
removeGutterMarkerFunction · 0.70
changeLineFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected