From: Juanma Barranquero Date: Wed, 9 Oct 2019 10:36:57 +0000 (+0200) Subject: Do not use tick faces beyond ZV (bug#37641) X-Git-Tag: emacs-27.0.90~1193 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4b06250ef1fe98a766938862912383d2ee051dfb;p=emacs.git Do not use tick faces beyond ZV (bug#37641) * src/xdisp.c (maybe_produce_line_number): Check beyond_zv before using a tick face for the line number. Move all face selection code outside the loop that draws the line number. --- diff --git a/src/xdisp.c b/src/xdisp.c index 1586a02e3d4..52275a11b86 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -22657,29 +22657,33 @@ maybe_produce_line_number (struct it *it) int width_limit = tem_it.last_visible_x - tem_it.first_visible_x - 3 * FRAME_COLUMN_WIDTH (it->f); - /* Produce glyphs for the line number in a scratch glyph_row. */ - for (const char *p = lnum_buf; *p; p++) - { - /* For continuation lines and lines after ZV, instead of a line - number, produce a blank prefix of the same width. */ - if (lnum_face_id != current_lnum_face_id - && (EQ (Vdisplay_line_numbers, Qvisual) - ? this_line == 0 - : this_line == it->pt_lnum) - /* Avoid displaying the line-number-current-line face on - empty lines beyond EOB. */ - && it->what != IT_EOB) - tem_it.face_id = current_lnum_face_id; - else if (display_line_numbers_major_tick > 0 - && (lnum_to_display % display_line_numbers_major_tick == 0)) + + tem_it.face_id = lnum_face_id; + /* Avoid displaying any face other than line-number on + empty lines beyond EOB. */ + if (lnum_face_id != current_lnum_face_id + && (EQ (Vdisplay_line_numbers, Qvisual) + ? this_line == 0 + : this_line == it->pt_lnum) + && it->what != IT_EOB) + tem_it.face_id = current_lnum_face_id; + else if (!beyond_zv) + { + if (display_line_numbers_major_tick > 0 + && (lnum_to_display % display_line_numbers_major_tick == 0)) tem_it.face_id = merge_faces (it->w, Qline_number_major_tick, 0, DEFAULT_FACE_ID); else if (display_line_numbers_minor_tick > 0 && (lnum_to_display % display_line_numbers_minor_tick == 0)) tem_it.face_id = merge_faces (it->w, Qline_number_minor_tick, 0, DEFAULT_FACE_ID); - else - tem_it.face_id = lnum_face_id; + } + + /* Produce glyphs for the line number in a scratch glyph_row. */ + for (const char *p = lnum_buf; *p; p++) + { + /* For continuation lines and lines after ZV, instead of a line + number, produce a blank prefix of the same width. */ if (beyond_zv /* Don't display the same line number more than once. */ || (!EQ (Vdisplay_line_numbers, Qvisual)