(pos)
| 2070 | |
| 2071 | // hint is null, leave the selection alone as much as possible |
| 2072 | var adjustPos = function(pos) { |
| 2073 | if (posLess(pos, change.from)) return pos; |
| 2074 | if (!posLess(change.to, pos)) return end; |
| 2075 | |
| 2076 | var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; |
| 2077 | if (pos.line == change.to.line) ch += end.ch - change.to.ch; |
| 2078 | return Pos(line, ch); |
| 2079 | }; |
| 2080 | return {anchor: adjustPos(doc.sel.anchor), head: adjustPos(doc.sel.head)}; |
| 2081 | } |
| 2082 |
no test coverage detected