comparison src/insdel.c @ 77621:beb7c0b976bd

(replace_range): For undo, record insertion first.
author Richard M. Stallman <rms@gnu.org>
date Sun, 29 Apr 2007 21:56:23 +0000
parents f8d6199cdf00
children 922696f363b0 70bf32a0f523
comparison
equal deleted inserted replaced
77620:f921023dc6d6 77621:beb7c0b976bd
1601 abort (); 1601 abort ();
1602 #endif 1602 #endif
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;
1611 GPT += inschars; 1615 GPT += inschars;
1612 ZV += inschars; 1616 ZV += inschars;