]> git.eshelyaron.com Git - emacs.git/commitdiff
(update_text_area): Fix last change.
authorGerd Moellmann <gerd@gnu.org>
Sat, 18 Nov 2000 23:56:52 +0000 (23:56 +0000)
committerGerd Moellmann <gerd@gnu.org>
Sat, 18 Nov 2000 23:56:52 +0000 (23:56 +0000)
src/ChangeLog
src/dispnew.c

index 20f2f1d6345aff7a6654cc6f5a7a9eadcb55fc4e..2ac749849c87e9fcc8e21a079c00bae9673ec116 100644 (file)
@@ -1,3 +1,7 @@
+2000-11-19  Gerd Moellmann  <gerd@gnu.org>
+
+       * dispnew.c (update_text_area): Fix last change.
+
 2000-11-18  Gerd Moellmann  <gerd@gnu.org>
 
        * xdisp.c: Use BINDING_STACK_SIZE throughout.
index 8e8f6c5b43703460da31ac21230e8bcc74b30367..39d2408a4f79e8249a49f7657d9d511ee5ea1692 100644 (file)
@@ -3996,7 +3996,7 @@ update_text_area (w, vpos)
       
       while (i < stop)
        {
-         int skip_equal_glyphs_p = 1;
+         int can_skip_p = 1;
          
          /* Skip over glyphs that both rows have in common.  These
             don't have to be written.  We can't skip if the last
@@ -4013,38 +4013,42 @@ update_text_area (w, vpos)
              
              rif->get_glyph_overhangs (glyph, XFRAME (w->frame),
                                        &left, &right);
-             skip_equal_glyphs_p = right == 0;
+             can_skip_p = right == 0;
            }
-
-         if (skip_equal_glyphs_p)
-           while (i < stop
-                  && GLYPH_EQUAL_P (desired_glyph, current_glyph))
-             {
-               x += desired_glyph->pixel_width;
-               ++desired_glyph, ++current_glyph, ++i;
-             }
-
-         /* Consider the case that the current row contains "xxx ppp
-            ggg" in italic Courier font, and the desired row is "xxx
-            ggg".  The character `p' has lbearing, `g' has not.  The
-            loop above will stop in front of the first `p' in the
-            current row.  If we would start writing glyphs there, we
-            wouldn't erase the lbearing of the `p'.  The rest of the
-            lbearing problem is then taken care of by x_draw_glyphs.  */
-         if (overlapping_glyphs_p
-             && i > 0
-             && i < current_row->used[TEXT_AREA]
-             && current_row->used[TEXT_AREA] != desired_row->used[TEXT_AREA])
+         
+         if (can_skip_p)
            {
-             int left, right;
-             
-             rif->get_glyph_overhangs (current_glyph, XFRAME (w->frame),
-                                       &left, &right);
-             while (left > 0 && i > 0)
+             while (i < stop
+                    && GLYPH_EQUAL_P (desired_glyph, current_glyph))
                {
-                 --i, --desired_glyph, --current_glyph;
-                 x -= desired_glyph->pixel_width;
-                 left -= desired_glyph->pixel_width;
+                 x += desired_glyph->pixel_width;
+                 ++desired_glyph, ++current_glyph, ++i;
+               }
+
+             /* Consider the case that the current row contains "xxx
+                ppp ggg" in italic Courier font, and the desired row
+                is "xxx ggg".  The character `p' has lbearing, `g'
+                has not.  The loop above will stop in front of the
+                first `p' in the current row.  If we would start
+                writing glyphs there, we wouldn't erase the lbearing
+                of the `p'.  The rest of the lbearing problem is then
+                taken care of by x_draw_glyphs.  */
+             if (overlapping_glyphs_p
+                 && i > 0
+                 && i < current_row->used[TEXT_AREA]
+                 && (current_row->used[TEXT_AREA]
+                     != desired_row->used[TEXT_AREA]))
+               {
+                 int left, right;
+             
+                 rif->get_glyph_overhangs (current_glyph, XFRAME (w->frame),
+                                           &left, &right);
+                 while (left > 0 && i > 0)
+                   {
+                     --i, --desired_glyph, --current_glyph;
+                     x -= desired_glyph->pixel_width;
+                     left -= desired_glyph->pixel_width;
+                   }
                }
            }
          
@@ -4057,15 +4061,18 @@ update_text_area (w, vpos)
              int start_x = x, start_hpos = i;
              struct glyph *start = desired_glyph;
              int current_x = x;
-             
+             int skip_first_p = !can_skip_p;
+
              /* Find the next glyph that's equal again.  */
              while (i < stop
-                    && !GLYPH_EQUAL_P (desired_glyph, current_glyph)
+                    && (skip_first_p
+                        || !GLYPH_EQUAL_P (desired_glyph, current_glyph))
                     && x == current_x)
                {
                  x += desired_glyph->pixel_width;
                  current_x += current_glyph->pixel_width;
                  ++desired_glyph, ++current_glyph, ++i;
+                 skip_first_p = 0;
                }
 
              if (i == start_hpos || x != current_x)