# HG changeset patch # User Richard M. Stallman # Date 1177883853 0 # Node ID 08b58b8cda2bafd08d804d50e5f4dbc688088d96 # Parent e712fac5ab3b0327668e956d11c66267872f1fe1 (replace_range): For undo, record insertion first. diff -r e712fac5ab3b -r 08b58b8cda2b src/insdel.c --- a/src/insdel.c Sun Apr 29 21:11:42 2007 +0000 +++ b/src/insdel.c Sun Apr 29 21:57:33 2007 +0000 @@ -1603,8 +1603,12 @@ if (! EQ (current_buffer->undo_list, Qt)) { + /* Record the insertion first, so that when we undo, + the deletion will be undone first. Thus, undo + will insert before deleting, and thus will keep + the markers before and after this text separate. */ + record_insert (from + SCHARS (deletion), inschars); record_delete (from, deletion); - record_insert (from, inschars); } GAP_SIZE -= outgoing_insbytes;