GNU bug report logs - #32337
26.1; display-line-numbers-mode makes cursor ill-aligned when number face is changed

Previous Next

Package: emacs;

Reported by: Carlos Pita <carlosjosepita <at> gmail.com>

Date: Tue, 31 Jul 2018 19:20:02 UTC

Severity: minor

Found in version 26.1

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

Bug is archived. No further changes may be made.

Full log


Message #71 received at 32337 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: rms <at> gnu.org, 32337 <at> debbugs.gnu.org
Subject: Re: bug#32337: 26.1; display-line-numbers-mode makes cursor
 ill-aligned when number face is changed
Date: Fri, 07 Sep 2018 10:53:52 +0300
> From: Carlos Pita <carlosjosepita <at> gmail.com>
> Date: Sat, 1 Sep 2018 15:50:27 +0100
> Cc: rms <at> gnu.org, 32337 <at> debbugs.gnu.org
> 
>  Would you like me to send you a patch, and run with it for a couple of
>  weeks, in case there are some unintended consequences?
> 
> Sure, it would be great, thanks!

Sorry for the delay, the patch, relative to the emacs-26 branch, is
below.  Please come back with your observations in a couple of weeks
(or earlier, if you discover some unexpected issues), and we will see
how to proceed with this.

One of the side effects of keeping the line-number face beyond EOB is
that the cursor on the EOB line will be smaller/larger than usual when
the line-number face has a non-default size.  Please tell whether you
see this is as a problem worth trying to fix (it isn't trivial).  Note
that similar effects happen in Emacs elsewhere, so this is not the
only situation where the cursor height is different from the default.

Thanks.

diff --git a/src/xdisp.c b/src/xdisp.c
index eccefa4..16b9261 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -21175,14 +21175,11 @@ maybe_produce_line_number (struct it *it)
   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.  Use the
-	 default face for the blank field beyond ZV.  */
-      if (beyond_zv)
-	tem_it.face_id = it->base_face_id;
-      else if (lnum_face_id != current_lnum_face_id
-	       && (EQ (Vdisplay_line_numbers, Qvisual)
-		   ? this_line == 0
-		   : this_line == it->pt_lnum))
+	 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))
 	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 126 days ago.

Previous Next


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