** This variable controls the number of lines of context that are given
** when scrolling through menus. (Similar to ``$$pager_context''.)
*/
+ { "menu_move_off", DT_BOOL, R_NONE, OPTMENUMOVEOFF, 0 },
+ /*
+ ** .pp
+ ** When \fIunset\fP, the bottom entry of menus will never scroll up past
+ ** the bottom of the screen, unless there are less entries than lines.
+ ** When \fIset\fP, the bottom entry may move off the bottom.
+ */
{ "menu_scroll", DT_BOOL, R_NONE, OPTMENUSCROLL, 0 },
/*
** .pp
int c = MIN (MenuContext, menu->pagelen / 2);
int old_top = menu->top;
- if (menu->max <= menu->pagelen) /* less entries than lines */
+ if (!option (OPTMENUMOVEOFF) && menu->max <= menu->pagelen) /* less entries than lines */
{
if (menu->top != 0) {
menu->top = 0;
menu->top -= (menu->pagelen - c) * ((menu->top + menu->pagelen - 1 - menu->current) / (menu->pagelen - c)) - c;
}
- /* make entries stick to bottom */
- menu->top = MIN (menu->top, menu->max - menu->pagelen);
+ if (!option (OPTMENUMOVEOFF)) /* make entries stick to bottom */
+ menu->top = MIN (menu->top, menu->max - menu->pagelen);
menu->top = MAX (menu->top, 0);
if (menu->top != old_top)
{
if (menu->max)
{
- if (menu->top + 1 < menu->max)
+ int c = MIN (MenuContext, menu->pagelen / 2);
+
+ if (menu->top + 1 < menu->max - c
+ && (option(OPTMENUMOVEOFF) || (menu->max > menu->pagelen && menu->top < menu->max - menu->pagelen)))
{
menu->top++;
- if (menu->current < menu->top)
+ if (menu->current < menu->top + c && menu->current < menu->max - 1)
menu->current++;
menu->redraw = REDRAW_INDEX;
}
{
if (menu->top > 0)
{
+ int c = MIN (MenuContext, menu->pagelen / 2);
+
menu->top--;
- if (menu->current >= menu->top + menu->pagelen)
+ if (menu->current >= menu->top + menu->pagelen - c && menu->current > 1)
menu->current--;
menu->redraw = REDRAW_INDEX;
}
OPTMARKERS,
OPTMARKOLD,
OPTMENUSCROLL, /* scroll menu instead of implicit next-page */
+ OPTMENUMOVEOFF, /* allow menu to scroll past last entry */
OPTMETAKEY, /* interpret ALT-x as ESC-x */
OPTMETOO,
OPTMHPURGE,