GNU bug report logs - #33732
27.0.50; line-number-current-line face bug

Previous Next

Package: emacs;

Reported by: Jonas Westlund <jonaswestlund101 <at> gmail.com>

Date: Thu, 13 Dec 2018 21:51:02 UTC

Severity: normal

Found in version 27.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jonas Westlund <jonaswestlund101 <at> gmail.com>
Cc: 33732 <at> debbugs.gnu.org
Subject: bug#33732: 27.0.50; line-number-current-line face bug
Date: Fri, 14 Dec 2018 10:46:30 +0200
> From: Jonas Westlund <jonaswestlund101 <at> gmail.com>
> Date: Thu, 13 Dec 2018 22:49:03 +0100
> 
> When using the built-in display-line-number, placing the point at the
> last line of the file/end of buffer will make the rest of
> the display-number area adopt the line-number-current-line
> face. Modifying the face's background thus produces this kind of effect:
> 
> https://i.imgur.com/pO214Wf.png

Thanks, I tried to fix this on the emacs-26 branch with the patch
below.

    Fix display of line numbers in empty lines beyond EOB
    
    * src/xdisp.c (maybe_produce_line_number): When the current
    line is at EOB, use the 'line-number-current-line' face only
    on that single line, but not on the rest of empty lines beyond
    EOB.  (Bug#33732)

diff --git a/src/xdisp.c b/src/xdisp.c
index 808eab7..435ab2c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -21185,7 +21185,10 @@ maybe_produce_line_number (struct it *it)
       if (lnum_face_id != current_lnum_face_id
 	  && (EQ (Vdisplay_line_numbers, Qvisual)
 	      ? this_line == 0
-	      : this_line == it->pt_lnum))
+	      : 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
 	tem_it.face_id = lnum_face_id;




This bug report was last modified 6 years and 150 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.