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 #92 received at 32337 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 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: Wed, 26 Sep 2018 18:39:42 +0300
> Date: Tue, 25 Sep 2018 22:46:49 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: rms <at> gnu.org, 32337 <at> 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);




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.