Commit 9dde4e0c authored by Kim F. Storm's avatar Kim F. Storm
Browse files

(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].
parent e4f10c83
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment