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

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

bug#19060: [FIX INCLUDED] Off-by-one-line scrolling bug in window_scroll


From: Eli Zaretskii
Subject: bug#19060: [FIX INCLUDED] Off-by-one-line scrolling bug in window_scroll_pixel_based
Date: Sat, 15 Nov 2014 13:17:47 +0200

> Date: Sat, 15 Nov 2014 12:13:17 +0100
> From: martin rudalics <rudalics@gmx.at>
> CC: 19060@debbugs.gnu.org
> 
>  > diff --git a/src/window.c b/src/window.c
>  > index b002423..7462fdc 100644
>  > --- a/src/window.c
>  > +++ b/src/window.c
>  > @@ -4956,8 +4956,8 @@ window_scroll_pixel_based (Lisp_Object window, int 
> n, bool whole, int noerror)
>  >      int px;
>  >      int dy = frame_line_height;
>  >      if (whole)
>  > -      dy = max ((window_box_height (w)
>  > -                 - next_screen_context_lines * dy),
>  > +      dy = max ((window_box_height (w) / dy
>  > +                 - next_screen_context_lines) * dy,
>  >                  dy);
>  >      dy *= n;
>  >
>  > @@ -5039,8 +5039,7 @@ window_scroll_pixel_based (Lisp_Object window, int 
> n, bool whole, int noerror)
>  >       {
>  >         ptrdiff_t start_pos = IT_CHARPOS (it);
>  >         int dy = frame_line_height;
>  > -      dy = max ((window_box_height (w)
>  > -           - next_screen_context_lines * dy),
>  > +      dy = max ((window_box_height (w) / dy - next_screen_context_lines) 
> * dy,
>  >            dy) * n;
>  >
>  >         /* Note that move_it_vertically always moves the iterator to the
> 
> If it works for you, please apply it.

It evidently works for Kelly.

> I'm too silly to understand it, though.  IIUC we have a rounding
> issue which makes us go by one line too far or too few when
> scrolling up and your patch compensates that rounding issue by
> putting it back into that window_box_height (w) / dy calculation.

Yes.  Why is it hard to understand?

> Could you add comments which tell more or less how you corrected the
> issue?

Will do, once we agree that this is the right fix.





reply via email to

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