diff options
| author | Gerd Moellmann | 2000-05-04 21:45:40 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-05-04 21:45:40 +0000 |
| commit | 06d8227a86b9cb00e2657c418992f14766aa02b3 (patch) | |
| tree | 1bf02c76e10fe0d10b5bf10fe27704ae820c0dde /src | |
| parent | 4656b314909549c3a0c9cf8144790d0f29ff590a (diff) | |
| download | emacs-06d8227a86b9cb00e2657c418992f14766aa02b3.tar.gz emacs-06d8227a86b9cb00e2657c418992f14766aa02b3.zip | |
(insert_from_buffer_1): Adjust FROM position by number
of inserted characters when BUF equals the current buffer, and PT
is in front of or equal to FROM.
Diffstat (limited to 'src')
| -rw-r--r-- | src/insdel.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/insdel.c b/src/insdel.c index 9facec4cf34..06e638526bc 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -1546,7 +1546,11 @@ insert_from_buffer_1 (buf, from, nchars, inherit) | |||
| 1546 | not including the combined-before bytes. */ | 1546 | not including the combined-before bytes. */ |
| 1547 | intervals = BUF_INTERVALS (buf); | 1547 | intervals = BUF_INTERVALS (buf); |
| 1548 | if (outgoing_nbytes < BUF_Z_BYTE (buf) - BUF_BEG_BYTE (buf)) | 1548 | if (outgoing_nbytes < BUF_Z_BYTE (buf) - BUF_BEG_BYTE (buf)) |
| 1549 | intervals = copy_intervals (intervals, from, nchars); | 1549 | { |
| 1550 | if (buf == current_buffer && PT <= from) | ||
| 1551 | from += nchars; | ||
| 1552 | intervals = copy_intervals (intervals, from, nchars); | ||
| 1553 | } | ||
| 1550 | 1554 | ||
| 1551 | /* Insert those intervals. */ | 1555 | /* Insert those intervals. */ |
| 1552 | graft_intervals_into_buffer (intervals, PT, nchars, current_buffer, inherit); | 1556 | graft_intervals_into_buffer (intervals, PT, nchars, current_buffer, inherit); |