unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Carlos Pita <carlosjosepita@gmail.com>
Cc: rms@gnu.org, 32337@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <83d0tpvj3j.fsf@gnu.org> (raw)
In-Reply-To: <CAELgYhdbiqh+u-9S=NbBH73XxgQQf4rJ1tK6j0pFCNqjR-b-6Q@mail.gmail.com> (message from Carlos Pita on Sat, 1 Sep 2018 15:50:27 +0100)

> From: Carlos Pita <carlosjosepita@gmail.com>
> Date: Sat, 1 Sep 2018 15:50:27 +0100
> Cc: rms@gnu.org, 32337@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;





  reply	other threads:[~2018-09-07  7:53 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31 19:19 bug#32337: 26.1; display-line-numbers-mode makes cursor ill-aligned when number face is changed Carlos Pita
2018-07-31 19:26 ` Carlos Pita
2018-08-01  7:48   ` Eli Zaretskii
2018-08-01 10:33     ` Carlos Pita
2018-08-01 10:38       ` Carlos Pita
2018-08-01 11:50       ` Eli Zaretskii
2018-08-01 12:03         ` Carlos Pita
2018-08-01 12:09           ` Eli Zaretskii
2018-08-01 12:31             ` Carlos Pita
2018-08-01 12:34               ` Eli Zaretskii
2018-08-02  2:08                 ` Richard Stallman
2018-08-02 23:06                   ` Carlos Pita
2018-08-03  6:03                     ` Eli Zaretskii
2018-08-03 18:40                       ` Carlos Pita
2018-08-03 23:14                         ` Carlos Pita
2018-08-04  6:29                           ` Eli Zaretskii
2018-08-04  7:07                             ` Eli Zaretskii
2018-08-07 17:12                               ` Carlos Pita
2018-08-31 12:10                                 ` Carlos Pita
2018-09-01 13:39                                   ` Eli Zaretskii
2018-09-01 14:50                                     ` Carlos Pita
2018-09-07  7:53                                       ` Eli Zaretskii [this message]
2018-09-25 19:27                                         ` Carlos Pita
2018-09-25 19:40                                           ` Carlos Pita
2018-09-25 19:54                                             ` Eli Zaretskii
2018-09-25 20:00                                               ` Carlos Pita
2018-09-25 19:46                                           ` Eli Zaretskii
2018-09-25 19:52                                             ` Carlos Pita
2018-09-26 15:39                                             ` Eli Zaretskii
2018-09-26 16:16                                               ` Carlos Pita
2018-09-26 19:20                                                 ` Eli Zaretskii
2018-10-10 18:33                                                   ` Carlos Pita
2018-10-13  6:46                                                     ` Eli Zaretskii
     [not found]                                                       ` <CAELgYhceFMmTc=G3VY6rmHKsk+g5upsM_n7w1xvjU-dvf7ZYYA@mail.gmail.com>
2019-02-19 15:26                                                         ` Carlos Pita
2019-02-19 15:27                                                           ` Carlos Pita
2019-02-19 16:57                                                         ` Eli Zaretskii
2019-02-19 20:01                                                           ` Carlos Pita
2019-02-19 22:38                                                             ` Carlos Pita
2018-08-01  7:47 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83d0tpvj3j.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=32337@debbugs.gnu.org \
    --cc=carlosjosepita@gmail.com \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).