aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2007-04-29 21:56:23 +0000
committerRichard M. Stallman2007-04-29 21:56:23 +0000
commit00993b140ddbef85334b18bf3e954d9d77c5173e (patch)
treef71eca0fbecb9cc067fca2aa26f2a38eee90571c
parentece59c464160414936e4e1f0afc8e73b19fbac8f (diff)
downloademacs-00993b140ddbef85334b18bf3e954d9d77c5173e.tar.gz
emacs-00993b140ddbef85334b18bf3e954d9d77c5173e.zip
(replace_range): For undo, record insertion first.
-rw-r--r--src/insdel.c6
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;