wclrtobot (main_w);
SETCOLOR(main_w, MT_COLOR_STATUS);
- wmove (main_w, option (OPTSTATUSONTOP) ? LINES - 2 : 0, 0);
+ wmove (main_w, LINES - 2, 0);
mutt_paddstr (main_w, getmaxx(main_w), "");
SETCOLOR(main_w, MT_COLOR_NORMAL);
menu->offset = 1;
snprintf (buf, sizeof (buf), M_MODEFMT, menu->title);
SETCOLOR(main_w, MT_COLOR_STATUS);
- wmove (main_w, option (OPTSTATUSONTOP) ? 0 : LINES - 2, 0);
+ wmove (main_w, 0, 0);
mutt_paddstr (main_w, getmaxx(main_w), buf);
SETCOLOR(main_w, MT_COLOR_NORMAL);
menu->redraw &= ~REDRAW_STATUS;
int c = MIN (MenuContext, menu->pagelen / 2);
int old_top = menu->top;
- if (!option (OPTMENUMOVEOFF) && menu->max <= menu->pagelen) { /* less entries than lines */
- if (menu->top != 0) {
- menu->top = 0;
- set_option (OPTNEEDREDRAW);
- }
+ if ((menu->pagelen <= 0) || (c < MenuContext)) {
+ if (menu->current < menu->top + c)
+ menu->top = menu->current - c;
+ else if (menu->current >= menu->top + menu->pagelen - c)
+ menu->top = menu->current - menu->pagelen + c + 1;
} else {
- if (option (OPTMENUSCROLL) || (menu->pagelen <= 0) || (c < MenuContext)) {
- if (menu->current < menu->top + c)
- menu->top = menu->current - c;
- else if (menu->current >= menu->top + menu->pagelen - c)
- menu->top = menu->current - menu->pagelen + c + 1;
- } else {
- if (menu->current < menu->top + c)
- menu->top -= (menu->pagelen - c) * ((menu->top + menu->pagelen - 1 - menu->current) / (menu->pagelen - c)) - c;
- else if ((menu->current >= menu->top + menu->pagelen - c))
- menu->top += (menu->pagelen - c) * ((menu->current - menu->top) / (menu->pagelen - c)) - c;
- }
+ if (menu->current < menu->top + c)
+ menu->top -= (menu->pagelen - c) * ((menu->top + menu->pagelen - 1 - menu->current) / (menu->pagelen - c)) - c;
+ else if ((menu->current >= menu->top + menu->pagelen - c))
+ menu->top += (menu->pagelen - c) * ((menu->current - menu->top) / (menu->pagelen - c)) - c;
}
- 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) {
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))) {
+ if (menu->top + 1 < menu->max - c) {
menu->top++;
if (menu->current < menu->top + c && menu->current < menu->max - 1)
menu->current++;
menu->redraw = REDRAW_INDEX;
- }
- else
+ } else {
mutt_error _("You cannot scroll down farther.");
- }
- else
+ }
+ } else {
mutt_error _("No entries.");
+ }
}
void menu_prev_line (MUTTMENU * menu)
menu->top += jumplen;
/* jumped too long? */
- if ((neg || !option (OPTMENUMOVEOFF)) && DIRECTION * menu->top > tmp)
+ if (neg && DIRECTION * menu->top > tmp)
menu->top = tmp;
/* need to move the cursor? */