aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 136e8391d46..f4e8aeee390 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -20788,7 +20788,8 @@ maybe_produce_line_number (struct it *it)
20788 scratch_glyph_row.reversed_p = false; 20788 scratch_glyph_row.reversed_p = false;
20789 scratch_glyph_row.used[TEXT_AREA] = 0; 20789 scratch_glyph_row.used[TEXT_AREA] = 0;
20790 SET_TEXT_POS (tem_it.position, 0, 0); 20790 SET_TEXT_POS (tem_it.position, 0, 0);
20791 tem_it.face_id = merge_faces (it->f, Qline_number, 0, DEFAULT_FACE_ID); 20791 tem_it.avoid_cursor_p = true;
20792 tem_it.bidi_p = true;
20792 tem_it.bidi_it.type = WEAK_EN; 20793 tem_it.bidi_it.type = WEAK_EN;
20793 /* According to UAX#9, EN goes up 2 levels in L2R paragraph and 20794 /* According to UAX#9, EN goes up 2 levels in L2R paragraph and
20794 1 level in R2L paragraphs. Emulate that, assuming we are in 20795 1 level in R2L paragraphs. Emulate that, assuming we are in
@@ -20797,10 +20798,16 @@ maybe_produce_line_number (struct it *it)
20797 20798
20798 /* Produce glyphs for the line number in a scratch glyph_row. */ 20799 /* Produce glyphs for the line number in a scratch glyph_row. */
20799 int n_glyphs_before; 20800 int n_glyphs_before;
20801 int lnum_face_id = merge_faces (it->f, Qline_number, 0, DEFAULT_FACE_ID);
20800 for (const char *p = lnum_buf; *p; p++) 20802 for (const char *p = lnum_buf; *p; p++)
20801 { 20803 {
20802 /* For continuation lines and lines after ZV, instead of a 20804 /* For continuation lines and lines after ZV, instead of a line
20803 line number, produce a blank prefix of the same width. */ 20805 number, produce a blank prefix of the same width. Use the
20806 default face for the blank field beyond ZV. */
20807 if (beyond_zv)
20808 tem_it.face_id = it->base_face_id;
20809 else
20810 tem_it.face_id = lnum_face_id;
20804 if (beyond_zv || it->continuation_lines_width > 0) 20811 if (beyond_zv || it->continuation_lines_width > 0)
20805 tem_it.c = tem_it.char_to_display = ' '; 20812 tem_it.c = tem_it.char_to_display = ' ';
20806 else 20813 else
@@ -21064,6 +21071,7 @@ display_line (struct it *it, int cursor_vpos)
21064 buffer reached. */ 21071 buffer reached. */
21065 if (!get_next_display_element (it)) 21072 if (!get_next_display_element (it))
21066 { 21073 {
21074 bool row_has_glyphs = false;
21067 /* Maybe add a space at the end of this line that is used to 21075 /* Maybe add a space at the end of this line that is used to
21068 display the cursor there under X. Set the charpos of the 21076 display the cursor there under X. Set the charpos of the
21069 first glyph of blank lines not corresponding to any text 21077 first glyph of blank lines not corresponding to any text
@@ -21073,10 +21081,13 @@ display_line (struct it *it, int cursor_vpos)
21073 else if ((append_space_for_newline (it, true) 21081 else if ((append_space_for_newline (it, true)
21074 && row->used[TEXT_AREA] == 1) 21082 && row->used[TEXT_AREA] == 1)
21075 || row->used[TEXT_AREA] == 0 21083 || row->used[TEXT_AREA] == 0
21076 || row_text_area_empty (row)) 21084 || (row_has_glyphs = row_text_area_empty (row)))
21077 { 21085 {
21078 row->glyphs[TEXT_AREA]->charpos = -1; 21086 row->glyphs[TEXT_AREA]->charpos = -1;
21079 row->displays_text_p = false; 21087 /* Don't reset the displays_text_p flag if we are
21088 displaying line numbers or line-prefix. */
21089 if (!row_has_glyphs)
21090 row->displays_text_p = false;
21080 21091
21081 if (!NILP (BVAR (XBUFFER (it->w->contents), indicate_empty_lines)) 21092 if (!NILP (BVAR (XBUFFER (it->w->contents), indicate_empty_lines))
21082 && (!MINI_WINDOW_P (it->w) 21093 && (!MINI_WINDOW_P (it->w)