MCPcopy
hub / github.com/nwutils/nw-sample-apps / clipLine

Function clipLine

mini-code-edit/cm/lib/codemirror.js:1239–1239  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

1237 }
1238
1239 function clipLine(n) {return Math.max(0, Math.min(n, doc.size-1));}
1240 function clipPos(pos) {
1241 if (pos.line < 0) return {line: 0, ch: 0};
1242 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