[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/line-numbers bbaf2f3 02/14: Fix background color b
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] scratch/line-numbers bbaf2f3 02/14: Fix background color beyond EOB and cursor display |
Date: |
Sat, 24 Jun 2017 13:12:51 -0400 (EDT) |
branch: scratch/line-numbers
commit bbaf2f3d529ac3f8d72b671ee3a8a0c3347c5510
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Fix background color beyond EOB and cursor display
* src/xdisp.c: (maybe_produce_line_number): Use the default face
for background of the blank glyphs in the line-number area which
are drawn beyond EOB.
(display_line): Reset the glyph row's displays_text_p flag only on
empty lines that don't display line numbers. This fixes cursor
display beyond EOB. Fix the bidi information in the glyphs
produced for line numbers. Set the avoid_cursor_p flag of glyphs
produced for line numbers.
---
src/xdisp.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/src/xdisp.c b/src/xdisp.c
index 136e839..f4e8aee 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -20788,7 +20788,8 @@ maybe_produce_line_number (struct it *it)
scratch_glyph_row.reversed_p = false;
scratch_glyph_row.used[TEXT_AREA] = 0;
SET_TEXT_POS (tem_it.position, 0, 0);
- tem_it.face_id = merge_faces (it->f, Qline_number, 0, DEFAULT_FACE_ID);
+ tem_it.avoid_cursor_p = true;
+ tem_it.bidi_p = true;
tem_it.bidi_it.type = WEAK_EN;
/* According to UAX#9, EN goes up 2 levels in L2R paragraph and
1 level in R2L paragraphs. Emulate that, assuming we are in
@@ -20797,10 +20798,16 @@ maybe_produce_line_number (struct it *it)
/* Produce glyphs for the line number in a scratch glyph_row. */
int n_glyphs_before;
+ int lnum_face_id = merge_faces (it->f, Qline_number, 0, DEFAULT_FACE_ID);
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. */
+ /* For continuation lines and lines after ZV, instead of a line
+ number, produce a blank prefix of the same width. Use the
+ default face for the blank field beyond ZV. */
+ if (beyond_zv)
+ tem_it.face_id = it->base_face_id;
+ else
+ tem_it.face_id = lnum_face_id;
if (beyond_zv || it->continuation_lines_width > 0)
tem_it.c = tem_it.char_to_display = ' ';
else
@@ -21064,6 +21071,7 @@ display_line (struct it *it, int cursor_vpos)
buffer reached. */
if (!get_next_display_element (it))
{
+ bool row_has_glyphs = false;
/* Maybe add a space at the end of this line that is used to
display the cursor there under X. Set the charpos of the
first glyph of blank lines not corresponding to any text
@@ -21073,10 +21081,13 @@ display_line (struct it *it, int cursor_vpos)
else if ((append_space_for_newline (it, true)
&& row->used[TEXT_AREA] == 1)
|| row->used[TEXT_AREA] == 0
- || row_text_area_empty (row))
+ || (row_has_glyphs = row_text_area_empty (row)))
{
row->glyphs[TEXT_AREA]->charpos = -1;
- row->displays_text_p = false;
+ /* Don't reset the displays_text_p flag if we are
+ displaying line numbers or line-prefix. */
+ if (!row_has_glyphs)
+ row->displays_text_p = false;
if (!NILP (BVAR (XBUFFER (it->w->contents), indicate_empty_lines))
&& (!MINI_WINDOW_P (it->w)
- [Emacs-diffs] scratch/line-numbers updated (7277c0f -> ead4ab6), Eli Zaretskii, 2017/06/24
- [Emacs-diffs] scratch/line-numbers 5b648ac 04/14: Fix problems with line-number updates in Follow mode, Eli Zaretskii, 2017/06/24
- [Emacs-diffs] scratch/line-numbers 77f8b86 03/14: Fix display of line numbers with fonts larger than the default, Eli Zaretskii, 2017/06/24
- [Emacs-diffs] scratch/line-numbers bbaf2f3 02/14: Fix background color beyond EOB and cursor display,
Eli Zaretskii <=
- [Emacs-diffs] scratch/line-numbers 9776d7b 05/14: Don't display line numbers in the minibuffer and in tooltip frames., Eli Zaretskii, 2017/06/24
- [Emacs-diffs] scratch/line-numbers ead4ab6 14/14: Improve documentation in NEWS., Eli Zaretskii, 2017/06/24
- [Emacs-diffs] scratch/line-numbers efedb66 08/14: Rename display-line-width, Eli Zaretskii, 2017/06/24
- [Emacs-diffs] scratch/line-numbers 13cc19a 12/14: Partial fix of hscroll of truncated lines with line numbers, Eli Zaretskii, 2017/06/24
- [Emacs-diffs] scratch/line-numbers 7d7602c 06/14: Fix crashes on TTY frames due to negative lnum_width., Eli Zaretskii, 2017/06/24
- [Emacs-diffs] scratch/line-numbers 55a9298 07/14: Fix tab stops when line numbers are displayed, Eli Zaretskii, 2017/06/24
- [Emacs-diffs] scratch/line-numbers 71a7294 10/14: Support a separate face for displaying the current line's number, Eli Zaretskii, 2017/06/24
- [Emacs-diffs] scratch/line-numbers d4eddb0 01/14: Fix display of indicate-empty-lines when line numbers are displayed, Eli Zaretskii, 2017/06/24
- [Emacs-diffs] scratch/line-numbers 0d5c713 13/14: Move additional hscrolling code into a suitable 'if', Eli Zaretskii, 2017/06/24
- [Emacs-diffs] scratch/line-numbers fa5e84c 09/14: Change display of current line in relative mode, Eli Zaretskii, 2017/06/24