Re: mutt/2019: menu_context itches
The following reply was made to PR mutt/2019; it has been noted by GNATS.
From: Thomas Roessler <roessler@xxxxxxxxxxxxxxxxxx>
To: bug-any@xxxxxxxxxxxxx, ossi@xxxxxxx,
Mutt Developers <mutt-dev@xxxxxxxx>
Cc:
Subject: Re: mutt/2019: menu_context itches
Date: Thu, 17 Nov 2005 18:23:51 +0100
On 2005-11-17 18:20:23 +0100, Thomas Roessler wrote:
> I seem to be unable to reproduce the problems that we've seen with
> the attached patch against current CVS, but I might still overlook
> some corner case.
A patch without another bug would truly be too nice, right?
Try ths one instead.
--=20
Thomas Roessler =B7 Personal soap box at <http://log.does-not-exist.org/>.
diff -u -r3.23 menu.c
--- menu.c 1 Nov 2005 08:42:00 -0000 3.23
+++ menu.c 17 Nov 2005 17:22:29 -0000
@@ -379,36 +379,27 @@
=20
if (!option (OPTMENUMOVEOFF) && menu->max <=3D menu->pagelen) /* less en=
tries than lines */
{
- if (menu->top !=3D 0) {
+ if (menu->top !=3D 0)=20
+ {
menu->top =3D 0;
set_option (OPTNEEDREDRAW);
}
}
else=20
{
- /*=20
- * If c =3D menu->pagelen / 2 and menu->pagelen is even, then (obvious=
ly):
- *=20
- * menu->top + menu->pagelen - c =3D=3D menu->top + c
- *
- * In that case, having an "else if" below leads to what has become kn=
own as the
- * indicator break dance effect. Instead of special-casing, we just f=
orget the=20
- * "else".
- */
- =20
- if (menu->current < menu->top + c) /* indicator above top threshold */
+ if (option (OPTMENUSCROLL) || (menu->pagelen <=3D 0) || (c && c <=3D M=
enuContext))
{
- if (option (OPTMENUSCROLL) || (menu->pagelen <=3D 0))
+ if (menu->current < menu->top + c)
menu->top =3D menu->current - c;
- else
- menu->top -=3D (menu->pagelen - c) * ((menu->top + menu->pagelen - 1 -
me=
nu->current) / (menu->pagelen - c)) - c;
+ if (menu->current >=3D menu->top + menu->pagelen - c)
+ menu->top =3D menu->current - menu->pagelen + c + 1;
}
- if (menu->current >=3D menu->top + menu->pagelen - c) /* indicator bel=
ow bottom threshold */
+ else
{
- if (option (OPTMENUSCROLL) || (menu->pagelen <=3D 0))
- menu->top =3D menu->current - menu->pagelen + c + 1;
- else
- menu->top +=3D (menu->pagelen - c) * ((menu->current - menu->top) /
(menu=
->pagelen - c)) - c;
+ if (menu->current < menu->top + c)
+ menu->top -=3D (menu->pagelen - c) * ((menu->top + menu->pagelen - 1 -
me=
nu->current) / (menu->pagelen - c)) - c;
+ else if (menu->current >=3D menu->top + menu->pagelen - c)
+ menu->top +=3D (menu->pagelen - c) * ((menu->current - menu->top) /
(menu=
->pagelen - c)) - c;=09
}
}