mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-28 08:11:05 -08:00
(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].
This commit is contained in:
parent
e4f10c83ed
commit
9dde4e0c8f
1 changed files with 12 additions and 0 deletions
12
src/insdel.c
12
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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue