Mercurial > emacs
changeset 89043:7c95cd050e6d
(insert_from_gap): Make it work even if PT != GTP.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Wed, 21 Aug 2002 13:07:13 +0000 |
parents | 2b9f8973f240 |
children | 4567dce0153f |
files | src/insdel.c |
diffstat | 1 files changed, 7 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/insdel.c Wed Aug 21 12:53:56 2002 +0000 +++ b/src/insdel.c Wed Aug 21 13:07:13 2002 +0000 @@ -1038,19 +1038,16 @@ } /* Insert a sequence of NCHARS chars which occupy NBYTES bytes - starting at GPT_ADDR. This funciton assumes PT == GPT. */ + starting at GPT_ADDR. */ void insert_from_gap (nchars, nbytes) register int nchars, nbytes; { - if (PT != GPT) - abort (); - if (NILP (current_buffer->enable_multibyte_characters)) nchars = nbytes; - record_insert (PT, nchars); + record_insert (GPT, nchars); MODIFF++; GAP_SIZE -= nbytes; @@ -1065,15 +1062,16 @@ if (GPT_BYTE < GPT) abort (); - adjust_overlays_for_insert (PT, nchars); - adjust_markers_for_insert (PT, PT_BYTE, - PT + nchars, PT_BYTE + nbytes, + adjust_overlays_for_insert (GPT, nchars); + adjust_markers_for_insert (GPT, GPT_BYTE, + GPT + nchars, GPT_BYTE + nbytes, 0); if (BUF_INTERVALS (current_buffer) != 0) offset_intervals (current_buffer, PT, nchars); - adjust_point (nchars, nbytes); + if (GPT - nchars < PT) + adjust_point (nchars, nbytes); CHECK_MARKERS (); }