]> git.eshelyaron.com Git - emacs.git/commitdiff
(verify_charstarts): Handle truncation of lines.
authorRichard M. Stallman <rms@gnu.org>
Tue, 5 Apr 1994 07:39:38 +0000 (07:39 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 5 Apr 1994 07:39:38 +0000 (07:39 +0000)
src/dispnew.c

index 7f795a4dc409a3811d7a5041735c251eeb74c490..dc109883b53ffa75cfc3f252448b8eb89cb7c89a 100644 (file)
@@ -935,6 +935,10 @@ adjust_window_charstarts (w, vpos, adjust)
     }
 }
 
+/* Check the charstarts values in the area of window W
+   for internal consistency.  We cannot check that they are "right";
+   we can only look for something nonsensical.  */
+
 verify_charstarts (w)
      struct window *w;
 {
@@ -945,17 +949,32 @@ verify_charstarts (w)
   int left = XFASTINT (w->left);
   int right = left + window_internal_width (w);
   int next_line;
+  int truncate = (XINT (w->hscroll)
+                 || (truncate_partial_width_windows
+                     && (XFASTINT (w->width) < FRAME_WIDTH (f)))
+                 || !NILP (XBUFFER (w->buffer)->truncate_lines));
 
   for (i = top; i < bottom; i++)
     {
       int j;
       int last;
-      int *charstart
-       = FRAME_CURRENT_GLYPHS (XFRAME (WINDOW_FRAME (w)))->charstarts[i];
+      int *charstart = FRAME_CURRENT_GLYPHS (f)->charstarts[i];
 
       if (i != top)
-       if (charstart[left] != next_line)
-         abort ();
+       {
+         if (truncate)
+           {
+             /* If we are truncating lines, allow a jump
+                in charstarts from one line to the next.  */
+             if (charstart[left] < next_line)
+               abort ();
+           }
+         else
+           {
+             if (charstart[left] != next_line)
+               abort ();
+           }
+       }
 
       for (j = left; j < right; j++)
        if (charstart[j] > 0)