(pos, from, to, diff)
| 8089 | // Rebasing/resetting history to deal with externally-sourced changes |
| 8090 | |
| 8091 | function rebaseHistSelSingle(pos, from, to, diff) { |
| 8092 | if (to < pos.line) { |
| 8093 | pos.line += diff; |
| 8094 | } else if (from < pos.line) { |
| 8095 | pos.line = from; |
| 8096 | pos.ch = 0; |
| 8097 | } |
| 8098 | } |
| 8099 | |
| 8100 | // Tries to rebase an array of history events given a change in the |
| 8101 | // document. If the change touches the same lines as the event, the |