(cm, pos, unit)
| 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) { |
no test coverage detected