(pos, from, to, diff)
| 277 | // Rebasing/resetting history to deal with externally-sourced changes |
| 278 | |
| 279 | function rebaseHistSelSingle(pos, from, to, diff) { |
| 280 | if (to < pos.line) { |
| 281 | pos.line += diff |
| 282 | } else if (from < pos.line) { |
| 283 | pos.line = from |
| 284 | pos.ch = 0 |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | // Tries to rebase an array of history events given a change in the |
| 289 | // document. If the change touches the same lines as the event, the |