(pos, linelen)
| 2550 | return clipToLen(pos, getLine(doc, pos.line).text.length); |
| 2551 | } |
| 2552 | function clipToLen(pos, linelen) { |
| 2553 | var ch = pos.ch; |
| 2554 | if (ch == null || ch > linelen) return Pos(pos.line, linelen); |
| 2555 | else if (ch < 0) return Pos(pos.line, 0); |
| 2556 | else return pos; |
| 2557 | } |
| 2558 | function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;} |
| 2559 | |
| 2560 | // If shift is held, this will move the selection anchor. Otherwise, |
no test coverage detected