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#25792: 26.0.50; Scroll-margin working incorrectly when scrolling down if show-trailing-whitespace is t Date: Mon, 20 Feb 2017 20:02:26 +0200 Message-ID: <83zihgoi4t.fsf@gnu.org> References: <93bc26e9-7026-65da-0738-57854568c106@web.de> <8760k6jevp.fsf@users.sourceforge.net> <83h93qp05z.fsf@gnu.org> <83fuj9q4r4.fsf@gnu.org> <87r32siwrh.fsf@users.sourceforge.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1487613792 29835 195.159.176.226 (20 Feb 2017 18:03:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 20 Feb 2017 18:03:12 +0000 (UTC) Cc: alexanderm@web.de, 25792@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 20 19:03:08 2017 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 1cfsIj-0007C0-WC for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Feb 2017 19:03:06 +0100 Original-Received: from localhost ([::1]:40233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfsIp-0001Ft-QK for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Feb 2017 13:03:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfsIh-0001Fj-Cp for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2017 13:03:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfsIg-0006Ka-Ho for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2017 13:03:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49546) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cfsIg-0006KV-E2 for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2017 13:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cfsIg-0008MF-6R for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2017 13:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Feb 2017 18:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25792 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 25792-submit@debbugs.gnu.org id=B25792.148761378032119 (code B ref 25792); Mon, 20 Feb 2017 18:03:02 +0000 Original-Received: (at 25792) by debbugs.gnu.org; 20 Feb 2017 18:03:00 +0000 Original-Received: from localhost ([127.0.0.1]:47745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfsIe-0008Lz-2z for submit@debbugs.gnu.org; Mon, 20 Feb 2017 13:03:00 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfsIb-0008Ll-VK for 25792@debbugs.gnu.org; Mon, 20 Feb 2017 13:02:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfsIW-0006Hc-1K for 25792@debbugs.gnu.org; Mon, 20 Feb 2017 13:02:52 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfsIR-0006Fo-0i; Mon, 20 Feb 2017 13:02:47 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1046 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cfsIP-0004zF-96; Mon, 20 Feb 2017 13:02:46 -0500 In-reply-to: <87r32siwrh.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) 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:129581 Archived-At: > From: npostavs@users.sourceforge.net > Cc: 25792@debbugs.gnu.org, alexanderm@web.de > Date: Mon, 20 Feb 2017 12:42:58 -0500 > > > If you invoke trace-redisplay and then run the recipe, you will see > > that there are two kinds of redisplay cycles: one that calls > > try_scrolling, the other that doesn't. So there are 2 different paths > > through redisplay, and they don't behave the same under these > > conditions. > > The difference seems to be that try_window returns -1 in the case where > we correctly stay out of the margin, but 1 in the case where we cross > into it. I tried adding a partial_line_height call, but it's not giving > the right answer. The move_it_to (&it, ZV, -1, it.last_visible_y, -1, > MOVE_TO_POS | MOVE_TO_Y) call doesn't stop at last_visible_y, it goes to > the end of buffer, so the returned partial height is a very large number > (approx 6500 in my test). Probably because it.current_y is already beyond it.last_visible_y, due to the loop before the call: /* Display all lines of W. */ while (it.current_y < it.last_visible_y) { if (display_line (&it)) last_text_row = it.glyph_row - 1; if (f->fonts_changed && !(flags & TRY_WINDOW_IGNORE_FONTS_CHANGE)) return 0; } Does it work to call start_display again, before the call to partial_line_height?