diff options
| author | Richard M. Stallman | 1999-02-18 05:40:34 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-02-18 05:40:34 +0000 |
| commit | c8a3c7eb277385a63813a356216d05087eb77f1c (patch) | |
| tree | c5a81b53899763bd5d9c9fd7c09770701c1acf30 /src | |
| parent | 3373a131dbf45da9ad119fd2bc9ea6522e7369c5 (diff) | |
| download | emacs-c8a3c7eb277385a63813a356216d05087eb77f1c.tar.gz emacs-c8a3c7eb277385a63813a356216d05087eb77f1c.zip | |
(adjust_markers_for_replace): When doing an insertion
(replacing a region of zero length), handle markers at the
insertion point properly.
Diffstat (limited to 'src')
| -rw-r--r-- | src/insdel.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/insdel.c b/src/insdel.c index 87f0a7898dc..f2aaa84a8b9 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -578,7 +578,12 @@ adjust_markers_for_replace (from, from_byte, old_chars, old_bytes, | |||
| 578 | { | 578 | { |
| 579 | register struct Lisp_Marker *m = XMARKER (marker); | 579 | register struct Lisp_Marker *m = XMARKER (marker); |
| 580 | 580 | ||
| 581 | if (m->bytepos >= prev_to_byte) | 581 | if (m->bytepos >= prev_to_byte |
| 582 | && (old_bytes != 0 | ||
| 583 | /* If this is an insertion (replacing 0 chars), | ||
| 584 | reject the case of a marker that is at the | ||
| 585 | insertion point and should stay before the insertion. */ | ||
| 586 | || m->bytepos > from_byte || m->insertion_type)) | ||
| 582 | { | 587 | { |
| 583 | if (m->bytepos < prev_to_byte + combined_after_bytes) | 588 | if (m->bytepos < prev_to_byte + combined_after_bytes) |
| 584 | { | 589 | { |