unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: 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: Wed, 26 Sep 2018 18:39:42 +0300	[thread overview]
Message-ID: <83d0t08dz5.fsf@gnu.org> (raw)
In-Reply-To: <83o9cl8imu.fsf@gnu.org> (message from Eli Zaretskii on Tue, 25 Sep 2018 22:46:49 +0300)

> Date: Tue, 25 Sep 2018 22:46:49 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: rms@gnu.org, 32337@debbugs.gnu.org
> 
> > some feedback: one problem I find with this approach is that, when
> > leaving the buffer, the filled up square cursor turns into an empty
> > box and then, since the face is smaller, it becomes apparent that it's
> > being cropped at the top and at the bottom (it looks like two vertical
> > lines, not one box). Isn't it possible to use the smaller font just
> > for the beginning of the line, as it is for the lines above EOB?
> 
> Not easily, because Emacs generally uses the face of the last
> character drawn for the cursor.

I may have found a solution.  Would you please apply the following
additional patch on top of the previous one, and see if it solves the
problem with the hollow cursor at EOB, and doesn't introduce any new
problems?  Please run with it for a couple of weeks before you
conclude whether any problems are left.

TIA

diff --git a/src/xdisp.c b/src/xdisp.c
index eccefa4..06a15e8 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2304,7 +2304,7 @@ get_phys_cursor_geometry (struct window *w, struct glyph_row *row,
      ascent value, lest the hollow cursor looks funny.  */
   y = w->phys_cursor.y;
   ascent = row->ascent;
-  if (row->ascent < glyph->ascent)
+  if (!row->ends_at_zv_p && row->ascent < glyph->ascent)
     {
       y -= glyph->ascent - row->ascent;
       ascent = glyph->ascent;
@@ -2314,6 +2314,7 @@ get_phys_cursor_geometry (struct window *w, struct glyph_row *row,
   h0 = min (FRAME_LINE_HEIGHT (f), row->visible_height);
 
   h = max (h0, ascent + glyph->descent);
+  h = min (h, row->height);
   h0 = min (h0, ascent + glyph->descent);
 
   y0 = WINDOW_HEADER_LINE_HEIGHT (w);





  parent reply	other threads:[~2018-09-26 15:39 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
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 [this message]
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=83d0t08dz5.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).