(pos, change)
| 4105 | // Adjust a position to refer to the post-change position of the |
| 4106 | // same text, or the end of the change if the change covers it. |
| 4107 | function adjustForChange(pos, change) { |
| 4108 | if (cmp(pos, change.from) < 0) return pos; |
| 4109 | if (cmp(pos, change.to) <= 0) return changeEnd(change); |
| 4110 | |
| 4111 | var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; |
| 4112 | if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch; |
| 4113 | return Pos(line, ch); |
| 4114 | } |
| 4115 | |
| 4116 | function computeSelAfterChange(doc, change) { |
| 4117 | var out = []; |
no test coverage detected