bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25792: 26.0.50; Scroll-margin working incorrectly when scrolling dow


From: Eli Zaretskii
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

> 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?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]