]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix display of line numbers with fonts larger than the default
authorEli Zaretskii <eliz@gnu.org>
Sat, 24 Jun 2017 08:34:52 +0000 (11:34 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 24 Jun 2017 08:34:52 +0000 (11:34 +0300)
* src/xdisp.c (maybe_produce_line_number): Update the metrics in
IT, not in IT->glyph_row, since the latter gets overwritten in
display_line.  Fixes display of line numbers when the font used
for them is larger than that of the default face.

src/xdisp.c

index f4e8aeee390080e013262daf69fedfc41eae6982..39176e0e675e720802d0d04ed25d6324c2327f99 100644 (file)
@@ -20849,19 +20849,16 @@ maybe_produce_line_number (struct it *it)
        }
     }
 
-  /* Update IT->glyph_row's metrics.  */
+  /* Update IT's metrics due to glyphs produced for line numbers.  */
   if (it->glyph_row)
     {
       struct glyph_row *row = it->glyph_row;
 
-      row->ascent = max (row->ascent, tem_it.max_ascent);
-      row->height = max (row->height,
-                        tem_it.max_ascent + tem_it.max_descent);
-      row->phys_ascent = max (row->phys_ascent, tem_it.max_phys_ascent);
-      row->phys_height = max (row->phys_height,
-                             tem_it.max_phys_ascent + tem_it.max_phys_descent);
-      row->extra_line_spacing = max (row->extra_line_spacing,
-                                    tem_it.max_extra_line_spacing);
+      it->max_ascent = max (row->ascent, tem_it.max_ascent);
+      it->max_descent = max (row->height - row->ascent, tem_it.max_descent);
+      it->max_phys_ascent = max (row->phys_ascent, tem_it.max_phys_ascent);
+      it->max_phys_descent = max (row->phys_height - row->phys_ascent,
+                                 tem_it.max_phys_descent);
     }
 
   bidi_unshelve_cache (itdata, false);