diff options
| author | Juanma Barranquero | 2019-10-09 12:36:57 +0200 |
|---|---|---|
| committer | Juanma Barranquero | 2019-10-09 12:37:30 +0200 |
| commit | 4b06250ef1fe98a766938862912383d2ee051dfb (patch) | |
| tree | 6a91abb1e88baf259c04c444258827e0bc0bb056 /src | |
| parent | 8e0761c842b61b67da648d9ac295d42f4654792d (diff) | |
| download | emacs-4b06250ef1fe98a766938862912383d2ee051dfb.tar.gz emacs-4b06250ef1fe98a766938862912383d2ee051dfb.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 38 |
1 files changed, 21 insertions, 17 deletions
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) | |||
| 22657 | int width_limit = | 22657 | int width_limit = |
| 22658 | tem_it.last_visible_x - tem_it.first_visible_x | 22658 | tem_it.last_visible_x - tem_it.first_visible_x |
| 22659 | - 3 * FRAME_COLUMN_WIDTH (it->f); | 22659 | - 3 * FRAME_COLUMN_WIDTH (it->f); |
| 22660 | /* Produce glyphs for the line number in a scratch glyph_row. */ | 22660 | |
| 22661 | for (const char *p = lnum_buf; *p; p++) | 22661 | tem_it.face_id = lnum_face_id; |
| 22662 | { | 22662 | /* Avoid displaying any face other than line-number on |
| 22663 | /* For continuation lines and lines after ZV, instead of a line | 22663 | empty lines beyond EOB. */ |
| 22664 | number, produce a blank prefix of the same width. */ | 22664 | if (lnum_face_id != current_lnum_face_id |
| 22665 | if (lnum_face_id != current_lnum_face_id | 22665 | && (EQ (Vdisplay_line_numbers, Qvisual) |
| 22666 | && (EQ (Vdisplay_line_numbers, Qvisual) | 22666 | ? this_line == 0 |
| 22667 | ? this_line == 0 | 22667 | : this_line == it->pt_lnum) |
| 22668 | : this_line == it->pt_lnum) | 22668 | && it->what != IT_EOB) |
| 22669 | /* Avoid displaying the line-number-current-line face on | 22669 | tem_it.face_id = current_lnum_face_id; |
| 22670 | empty lines beyond EOB. */ | 22670 | else if (!beyond_zv) |
| 22671 | && it->what != IT_EOB) | 22671 | { |
| 22672 | tem_it.face_id = current_lnum_face_id; | 22672 | if (display_line_numbers_major_tick > 0 |
| 22673 | else if (display_line_numbers_major_tick > 0 | 22673 | && (lnum_to_display % display_line_numbers_major_tick == 0)) |
| 22674 | && (lnum_to_display % display_line_numbers_major_tick == 0)) | ||
| 22675 | tem_it.face_id = merge_faces (it->w, Qline_number_major_tick, | 22674 | tem_it.face_id = merge_faces (it->w, Qline_number_major_tick, |
| 22676 | 0, DEFAULT_FACE_ID); | 22675 | 0, DEFAULT_FACE_ID); |
| 22677 | else if (display_line_numbers_minor_tick > 0 | 22676 | else if (display_line_numbers_minor_tick > 0 |
| 22678 | && (lnum_to_display % display_line_numbers_minor_tick == 0)) | 22677 | && (lnum_to_display % display_line_numbers_minor_tick == 0)) |
| 22679 | tem_it.face_id = merge_faces (it->w, Qline_number_minor_tick, | 22678 | tem_it.face_id = merge_faces (it->w, Qline_number_minor_tick, |
| 22680 | 0, DEFAULT_FACE_ID); | 22679 | 0, DEFAULT_FACE_ID); |
| 22681 | else | 22680 | } |
| 22682 | tem_it.face_id = lnum_face_id; | 22681 | |
| 22682 | /* Produce glyphs for the line number in a scratch glyph_row. */ | ||
| 22683 | for (const char *p = lnum_buf; *p; p++) | ||
| 22684 | { | ||
| 22685 | /* For continuation lines and lines after ZV, instead of a line | ||
| 22686 | number, produce a blank prefix of the same width. */ | ||
| 22683 | if (beyond_zv | 22687 | if (beyond_zv |
| 22684 | /* Don't display the same line number more than once. */ | 22688 | /* Don't display the same line number more than once. */ |
| 22685 | || (!EQ (Vdisplay_line_numbers, Qvisual) | 22689 | || (!EQ (Vdisplay_line_numbers, Qvisual) |