From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#48170: next-line on large lines or images skips unexpectedly to next logical line Date: Mon, 03 May 2021 20:02:00 +0300 Message-ID: <8335v37nuf.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29749"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48170@debbugs.gnu.org To: Radon Rosborough Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 03 19:14:22 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldc9G-0007cw-EY for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 May 2021 19:14:22 +0200 Original-Received: from localhost ([::1]:48032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldc9F-0002gi-F5 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 May 2021 13:14:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldbyI-0002T8-7c for bug-gnu-emacs@gnu.org; Mon, 03 May 2021 13:03:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36001) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldbyH-0007Qn-Kw for bug-gnu-emacs@gnu.org; Mon, 03 May 2021 13:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ldbyH-0000l1-IK for bug-gnu-emacs@gnu.org; Mon, 03 May 2021 13:03: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: Mon, 03 May 2021 17:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48170 X-GNU-PR-Package: emacs Original-Received: via spool by 48170-submit@debbugs.gnu.org id=B48170.16200613562896 (code B ref 48170); Mon, 03 May 2021 17:03:01 +0000 Original-Received: (at 48170) by debbugs.gnu.org; 3 May 2021 17:02:36 +0000 Original-Received: from localhost ([127.0.0.1]:47546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldbxr-0000ke-SU for submit@debbugs.gnu.org; Mon, 03 May 2021 13:02:36 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldbxq-0000kX-15 for 48170@debbugs.gnu.org; Mon, 03 May 2021 13:02:34 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57996) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldbxi-0007BX-KE; Mon, 03 May 2021 13:02:27 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3332 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ldbxZ-0008SK-Lm; Mon, 03 May 2021 13:02:19 -0400 In-Reply-To: (message from Radon Rosborough on Sun, 2 May 2021 13:41:54 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:205534 Archived-At: > From: Radon Rosborough > Date: Sun, 2 May 2021 13:41:54 -0700 > > The bug is that (under certain circumstances) when using `next-line' > on a long, visually-wrapped line, instead of moving to the next visual > line, point moves to the next logical line. > > The "certain circumstances" are as follows: > 1. Point is within a long logical line that is visually wrapped onto > at least two visual lines (the visual line containing point, and at > least one subsequent visual line). > 2. The window line containing point is the bottom-most window line > that is fully visible. > 3. The next window line is partially visible, and the pixel height of > the visible part of that line is less than the default line height (as > returned by `default-line-height'). Thanks. Preliminary analysis indicates that this use case was never supported, since line-move-visual was introduced in Emacs 23. This is somewhat tricky to debug (and %$#@! Edebug doesn't help), so stay tuned. > I did some debugging in the course of identifying the conditions to > reproduce the bug, and the problematic behavior seems to come down to > something in the implementation of `line-move-partial'. There's a > conditional check (<= this-ypos (- dlh)) in `line-move-partial' that > gets triggered for certain combinations of window sizes and font > heights, and the code gated behind this check appears to be buggy, > resulting in the observed behavior. In my testing this part is never executed. And it shouldn't be, because it handles the case where the window is vscrolled and the current line starts above the top of the window. Which is not the case here, at least not with the default frame size and window that is not too small.