void menu_redraw_motion(struct Menu *menu)
{
char buf[LONG_STRING];
- int old_color, cur_color;
if (menu->dialog)
{
* over imap (if matching against ~h for instance). This can
* generate status messages. So we want to call it *before* we
* position the cursor for drawing. */
- old_color = menu->color(menu->oldcurrent);
+ const int old_color = menu->color(menu->oldcurrent);
mutt_window_move(menu->indexwin, menu->oldcurrent + menu->offset - menu->top, 0);
ATTRSET(old_color);
print_enriched_string(menu->oldcurrent, old_color, (unsigned char *) buf, 1);
/* now draw the new one to reflect the change */
- cur_color = menu->color(menu->current);
+ const int cur_color = menu->color(menu->current);
menu_make_entry(buf, sizeof(buf), menu, menu->current);
menu_pad_string(menu, buf, sizeof(buf));
SETCOLOR(MT_COLOR_INDICATOR);
static void menu_jump(struct Menu *menu)
{
int n;
- char buf[SHORT_STRING];
if (menu->max)
{
mutt_unget_event(LastKey, 0);
+ char buf[SHORT_STRING];
buf[0] = '\0';
if (mutt_get_field(_("Jump to: "), buf, sizeof(buf), 0) == 0 && buf[0])
{
#define DIRECTION ((neg * 2) + 1)
static void menu_length_jump(struct Menu *menu, int jumplen)
{
- int tmp, neg = (jumplen >= 0) ? 0 : -1;
- int c = MIN(MenuContext, menu->pagelen / 2);
+ const int neg = (jumplen >= 0) ? 0 : -1;
+ const int c = MIN(MenuContext, menu->pagelen / 2);
if (menu->max)
{
/* possible to scroll? */
+ int tmp;
if (DIRECTION * menu->top <
(tmp = (neg ? 0 : (menu->max /* -1 */) - (menu->pagelen /* -1 */))))
{
void menu_middle_page(struct Menu *menu)
{
- int i;
-
if (menu->max)
{
- i = menu->top + menu->pagelen;
+ int i = menu->top + menu->pagelen;
if (i > menu->max - 1)
i = menu->max - 1;
menu->current = menu->top + (i - menu->top) / 2;