MCPcopy
hub / github.com/witheve/Eve / isInRange

Function isInRange

src/codemirror.js:13271–13285  ·  view source on GitHub ↗

* Check if pos is in the specified range, INCLUSIVE. * Range can be specified with 1 or 2 arguments. * If the first range argument is an array, treat it as an array of line * numbers. Match pos against any of the lines. * If the first range argument is a number, * if there

(pos, start, end)

Source from the content-addressed store, hash-verified

13269 * range arguments.
13270 */
13271 function isInRange(pos, start, end) {
13272 if (typeof pos != 'number') {
13273 // Assume it is a cursor position. Get the line number.
13274 pos = pos.line;
13275 }
13276 if (start instanceof Array) {
13277 return inArray(pos, start);
13278 } else {
13279 if (end) {
13280 return (pos >= start && pos <= end);
13281 } else {
13282 return pos == start;
13283 }
13284 }
13285 }
13286 function getUserVisibleLines(cm) {
13287 var scrollInfo = cm.getScrollInfo();
13288 var occludeToleranceTop = 6;

Callers 1

nextFunction · 0.85

Calls 1

inArrayFunction · 0.85

Tested by

no test coverage detected