]> git.eshelyaron.com Git - emacs.git/commitdiff
(adjust_markers_for_replace): When doing an insertion
authorRichard M. Stallman <rms@gnu.org>
Thu, 18 Feb 1999 05:40:34 +0000 (05:40 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 18 Feb 1999 05:40:34 +0000 (05:40 +0000)
(replacing a region of zero length), handle markers at the
insertion point properly.

src/insdel.c

index 87f0a7898dc88401a2198f004cea98b1542aa4d4..f2aaa84a8b9d4fbc930dcae50996448c73115876 100644 (file)
@@ -578,7 +578,12 @@ adjust_markers_for_replace (from, from_byte, old_chars, old_bytes,
     {
       register struct Lisp_Marker *m = XMARKER (marker);
 
-      if (m->bytepos >= prev_to_byte)
+      if (m->bytepos >= prev_to_byte
+         && (old_bytes != 0
+             /* If this is an insertion (replacing 0 chars),
+                reject the case of a marker that is at the
+                insertion point and should stay before the insertion.  */
+             || m->bytepos > from_byte || m->insertion_type))
        {
          if (m->bytepos < prev_to_byte + combined_after_bytes)
            {