diff options
author | Kim F. Storm <[email protected]> | 2002-06-13 22:07:13 +0000 |
---|---|---|
committer | Kim F. Storm <[email protected]> | 2002-06-13 22:07:13 +0000 |
commit | 9dde4e0c8f89a33195cdbe33fe18ce8b89e07a92 (patch) | |
tree | b4883f7f77e0ceba8ffef33d88c281a45a9c3fc3 /src/insdel.c | |
parent | e4f10c83edb0dd081a91cceb50164188793ac7c4 (diff) |
(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].
Diffstat (limited to 'src/insdel.c')
-rw-r--r-- | src/insdel.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/insdel.c b/src/insdel.c index 365819b2cf..5bec29ea92 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, |