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

Function rangeForUnit

samples/common/codehighlight/codemirror.js:7424–7430  ·  view source on GitHub ↗
(cm, pos, unit)

Source from the content-addressed store, hash-verified

7422 }
7423
7424 function rangeForUnit(cm, pos, unit) {
7425 if (unit == "char") { return new Range(pos, pos) }
7426 if (unit == "word") { return cm.findWordAt(pos) }
7427 if (unit == "line") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }
7428 var result = unit(cm, pos);
7429 return new Range(result.from, result.to)
7430 }
7431
7432 // Normal selection, as opposed to text dragging.
7433 function leftButtonSelect(cm, event, start, behavior) {

Callers 2

leftButtonSelectFunction · 0.85
extendToFunction · 0.85

Calls 2

PosFunction · 0.85
clipPosFunction · 0.85

Tested by

no test coverage detected