# HG changeset patch # User Kim F. Storm # Date 1024006033 0 # Node ID e70fd49212a02136eb2fdfc1b72b71e6091bf6ff # Parent 3a276adf4d804320f51db64abdcbe47870e221e0 (insert_1_both, insert_from_string_1) (insert_from_buffer_1): Recalculate END_UNCHANGED in case the insert happened in the end_unchanged region. Otherwise, the redisplay may be confused and duplicate the last line in the buffer [seen after save-buffer when require-final-newline==t]. diff -r 3a276adf4d80 -r e70fd49212a0 src/insdel.c --- a/src/insdel.c Thu Jun 13 22:06:32 2002 +0000 +++ b/src/insdel.c Thu Jun 13 22:07:13 2002 +0000 @@ -1031,6 +1031,10 @@ if (GPT_BYTE < GPT) abort (); + /* The insert may have been in the unchanged region, so check again. */ + if (Z - GPT < END_UNCHANGED) + END_UNCHANGED = Z - GPT; + adjust_overlays_for_insert (PT, nchars); adjust_markers_for_insert (PT, PT_BYTE, PT + nchars, PT_BYTE + nbytes, @@ -1154,6 +1158,10 @@ if (GPT_BYTE < GPT) abort (); + /* The insert may have been in the unchanged region, so check again. */ + if (Z - GPT < END_UNCHANGED) + END_UNCHANGED = Z - GPT; + adjust_overlays_for_insert (PT, nchars); adjust_markers_for_insert (PT, PT_BYTE, PT + nchars, PT_BYTE + outgoing_nbytes, @@ -1301,6 +1309,10 @@ if (GPT_BYTE < GPT) abort (); + /* The insert may have been in the unchanged region, so check again. */ + if (Z - GPT < END_UNCHANGED) + END_UNCHANGED = Z - GPT; + adjust_overlays_for_insert (PT, nchars); adjust_markers_for_insert (PT, PT_BYTE, PT + nchars, PT_BYTE + outgoing_nbytes,