changeset 45818:e70fd49212a0

(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].
author Kim F. Storm <storm@cua.dk>
date Thu, 13 Jun 2002 22:07:13 +0000
parents 3a276adf4d80
children a04951f92260
files src/insdel.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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,