# HG changeset patch # User Richard M. Stallman # Date 1177883783 0 # Node ID beb7c0b976bd236aa7c83609757a8f90085404d8 # Parent f921023dc6d62c80ceb76af561ffd2e9ce99ea58 (replace_range): For undo, record insertion first. diff -r f921023dc6d6 -r beb7c0b976bd src/insdel.c --- a/src/insdel.c Sun Apr 29 21:10:46 2007 +0000 +++ b/src/insdel.c Sun Apr 29 21:56:23 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;