From: Kim F. Storm Date: Thu, 13 Jun 2002 22:07:13 +0000 (+0000) Subject: (insert_1_both, insert_from_string_1) X-Git-Tag: ttn-vms-21-2-B4~14620 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9dde4e0c8f89a33195cdbe33fe18ce8b89e07a92;p=emacs.git (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 --git a/src/insdel.c b/src/insdel.c index 365819b2cff..5bec29ea926 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1031,6 +1031,10 @@ insert_1_both (string, nchars, nbytes, inherit, prepare, before_markers) 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 @@ insert_from_string_1 (string, pos, pos_byte, nchars, nbytes, 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 @@ insert_from_buffer_1 (buf, from, nchars, inherit) 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,