(cm, pos, unit)
| 10160 | } |
| 10161 | |
| 10162 | function rangeForUnit(cm, pos, unit) { |
| 10163 | if (unit == "char") { |
| 10164 | return new Range(pos, pos) |
| 10165 | } |
| 10166 | if (unit == "word") { |
| 10167 | return cm.findAtomAt(pos) |
| 10168 | } |
| 10169 | if (unit == "line") { |
| 10170 | return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) |
| 10171 | } |
| 10172 | var result = unit(cm, pos) |
| 10173 | return new Range(result.from, result.to) |
| 10174 | } |
| 10175 | |
| 10176 | // Normal selection, as opposed to text dragging. |
| 10177 | function leftButtonSelect(cm, event, start, behavior) { |
no test coverage detected