(pos, change)
| 4636 | // Adjust a position to refer to the post-change position of the |
| 4637 | // same text, or the end of the change if the change covers it. |
| 4638 | function adjustForChange(pos, change) { |
| 4639 | if (cmp(pos, change.from) < 0) { return pos } |
| 4640 | if (cmp(pos, change.to) <= 0) { return changeEnd(change) } |
| 4641 | |
| 4642 | var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; |
| 4643 | if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; } |
| 4644 | return Pos(line, ch) |
| 4645 | } |
| 4646 | |
| 4647 | function computeSelAfterChange(doc, change) { |
| 4648 | var out = []; |
no test coverage detected