(pos)
| 2315 | |
| 2316 | // hint is null, leave the selection alone as much as possible |
| 2317 | var adjustPos = function(pos) { |
| 2318 | if (posLess(pos, change.from)) return pos; |
| 2319 | if (!posLess(change.to, pos)) return end; |
| 2320 | |
| 2321 | var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; |
| 2322 | if (pos.line == change.to.line) ch += end.ch - change.to.ch; |
| 2323 | return Pos(line, ch); |
| 2324 | }; |
| 2325 | return {anchor: adjustPos(doc.sel.anchor), head: adjustPos(doc.sel.head)}; |
| 2326 | } |
| 2327 |
no test coverage detected