diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/insdel.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/insdel.c b/src/insdel.c index 7f15f7de52d..65d60b6b8e3 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -1603,8 +1603,12 @@ replace_range (from, to, new, prepare, inherit, markers) | |||
| 1603 | 1603 | ||
| 1604 | if (! EQ (current_buffer->undo_list, Qt)) | 1604 | if (! EQ (current_buffer->undo_list, Qt)) |
| 1605 | { | 1605 | { |
| 1606 | /* Record the insertion first, so that when we undo, | ||
| 1607 | the deletion will be undone first. Thus, undo | ||
| 1608 | will insert before deleting, and thus will keep | ||
| 1609 | the markers before and after this text separate. */ | ||
| 1610 | record_insert (from + SCHARS (deletion), inschars); | ||
| 1606 | record_delete (from, deletion); | 1611 | record_delete (from, deletion); |
| 1607 | record_insert (from, inschars); | ||
| 1608 | } | 1612 | } |
| 1609 | 1613 | ||
| 1610 | GAP_SIZE -= outgoing_insbytes; | 1614 | GAP_SIZE -= outgoing_insbytes; |