(pos, change)
| 6399 | // Adjust a position to refer to the post-change position of the |
| 6400 | // same text, or the end of the change if the change covers it. |
| 6401 | function adjustForChange(pos, change) { |
| 6402 | if (cmp(pos, change.from) < 0) { |
| 6403 | return pos |
| 6404 | } |
| 6405 | if (cmp(pos, change.to) <= 0) { |
| 6406 | return changeEnd(change) |
| 6407 | } |
| 6408 | |
| 6409 | var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, |
| 6410 | ch = pos.ch |
| 6411 | if (pos.line == change.to.line) { |
| 6412 | ch += changeEnd(change).ch - change.to.ch |
| 6413 | } |
| 6414 | return Pos(line, ch) |
| 6415 | } |
| 6416 | |
| 6417 | function computeSelAfterChange(doc, change) { |
| 6418 | var out = [] |
no test coverage detected