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.
This commit is contained in:
parent
8e0761c842
commit
4b06250ef1
1 changed files with 20 additions and 16 deletions
36
src/xdisp.c
36
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++)
|
||||
|
||||
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)
|
||||
{
|
||||
/* 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))
|
||||
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)
|
||||
|
|
Loading…
Add table
Reference in a new issue