From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83d0t08dz5.fsf@gnu.org> References: <87effjtdpw.fsf@gmail.com> <838t5qo7cw.fsf@gnu.org> <83y3dqmhkl.fsf@gnu.org> <83va8umgok.fsf@gnu.org> <83tvoemfjo.fsf@gnu.org> <83bmakugtw.fsf@gnu.org> <83k1p6tzjj.fsf@gnu.org> <83in4qtxt0.fsf@gnu.org> <83va7p1glx.fsf@gnu.org> <83d0tpvj3j.fsf@gnu.org> <83o9cl8imu.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1537976347 31311 195.159.176.226 (26 Sep 2018 15:39:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Sep 2018 15:39:07 +0000 (UTC) Cc: rms@gnu.org, 32337@debbugs.gnu.org To: carlosjosepita@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 26 17:39:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g5Bu0-0007yv-VH for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Sep 2018 17:39:01 +0200 Original-Received: from localhost ([::1]:59385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5Bw7-0006kJ-Fg for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Sep 2018 11:41:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5Bw1-0006k9-D6 for bug-gnu-emacs@gnu.org; Wed, 26 Sep 2018 11:41:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5Bvy-0008OL-5N for bug-gnu-emacs@gnu.org; Wed, 26 Sep 2018 11:41:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51314) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g5Bvx-0008OC-WD for bug-gnu-emacs@gnu.org; Wed, 26 Sep 2018 11:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g5Bvx-0006Ck-QZ for bug-gnu-emacs@gnu.org; Wed, 26 Sep 2018 11:41:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Sep 2018 15:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32337 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32337-submit@debbugs.gnu.org id=B32337.153797640923777 (code B ref 32337); Wed, 26 Sep 2018 15:41:01 +0000 Original-Received: (at 32337) by debbugs.gnu.org; 26 Sep 2018 15:40:09 +0000 Original-Received: from localhost ([127.0.0.1]:55572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g5Bv7-0006BR-HG for submit@debbugs.gnu.org; Wed, 26 Sep 2018 11:40:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43979) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g5Bv6-0006Az-Nj for 32337@debbugs.gnu.org; Wed, 26 Sep 2018 11:40:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5Buy-000761-C3 for 32337@debbugs.gnu.org; Wed, 26 Sep 2018 11:40:03 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5Buy-00075u-7I; Wed, 26 Sep 2018 11:40:00 -0400 Original-Received: from [176.228.60.248] (port=1298 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g5Buj-0003m3-UM; Wed, 26 Sep 2018 11:39:46 -0400 In-reply-to: <83o9cl8imu.fsf@gnu.org> (message from Eli Zaretskii on Tue, 25 Sep 2018 22:46:49 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:150684 Archived-At: > Date: Tue, 25 Sep 2018 22:46:49 +0300 > From: Eli Zaretskii > 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);