changeset 24342:39caae99e25d

(adjust_markers_for_replace): When doing an insertion (replacing a region of zero length), handle markers at the insertion point properly.
author Richard M. Stallman <rms@gnu.org>
date Thu, 18 Feb 1999 05:40:34 +0000
parents 9028f3cd0a5e
children d00b069a7d17
files src/insdel.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/insdel.c	Thu Feb 18 01:10:46 1999 +0000
+++ b/src/insdel.c	Thu Feb 18 05:40:34 1999 +0000
@@ -578,7 +578,12 @@
     {
       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)
 	    {