From 77f8b86e405cc0ff9c49aea5d98097212755b832 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 24 Jun 2017 11:34:52 +0300 Subject: [PATCH] Fix display of line numbers with fonts larger than the default * 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 | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index f4e8aeee390..39176e0e675 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -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); -- 2.39.2