changeset 52679:32ebe48159a6

(graft_intervals_into_buffer): Handle over_used when splitting UNDER. Set BUF_INTERVALS (buffer)->up_obj when appropriate.
author Richard M. Stallman <rms@gnu.org>
date Tue, 30 Sep 2003 12:33:19 +0000
parents 06b72306eaae
children 3614833210ba
files src/intervals.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/intervals.c	Tue Sep 30 11:47:57 2003 +0000
+++ b/src/intervals.c	Tue Sep 30 12:33:19 2003 +0000
@@ -1746,6 +1746,7 @@
 	  XSETBUFFER (buf, buffer);
 	  BUF_INTERVALS (buffer) = reproduce_tree_obj (source, buf);
 	  BUF_INTERVALS (buffer)->position = BEG;
+	  BUF_INTERVALS (buffer)->up_obj = 1;
 
 	  /* Explicitly free the old tree here?  */
 
@@ -1768,6 +1769,7 @@
     {
       BUF_INTERVALS (buffer) = reproduce_tree (source, INTERVAL_PARENT (tree));
       BUF_INTERVALS (buffer)->position = BEG;
+      BUF_INTERVALS (buffer)->up_obj = 1;
       /* Explicitly free the old tree here.  */
 
       return;
@@ -1823,9 +1825,9 @@
   while (! NULL_INTERVAL_P (over))
     {
       /* If UNDER is longer than OVER, split it.  */
-      if (LENGTH (over) < LENGTH (under))
+      if (LENGTH (over) - over_used < LENGTH (under))
 	{
-	  this = split_interval_left (under, LENGTH (over));
+	  this = split_interval_left (under, LENGTH (over) - over_used);
 	  copy_properties (under, this);
 	}
       else