(pos, from, to, diff)
| 5495 | // Rebasing/resetting history to deal with externally-sourced changes |
| 5496 | |
| 5497 | function rebaseHistSelSingle(pos, from, to, diff) { |
| 5498 | if (to < pos.line) { |
| 5499 | pos.line += diff; |
| 5500 | } else if (from < pos.line) { |
| 5501 | pos.line = from; |
| 5502 | pos.ch = 0; |
| 5503 | } |
| 5504 | } |
| 5505 | |
| 5506 | // Tries to rebase an array of history events given a change in the |
| 5507 | // document. If the change touches the same lines as the event, the |