Change the index screen to use MuttIndexWindow and MuttStatusWindow. -- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA http://www.8t8.us/configs/gpg-key-transition-statement.txt
# HG changeset patch # User Kevin McCarthy <ke...@8t8.us> # Date 1461089300 25200 # Tue Apr 19 11:08:20 2016 -0700 # Node ID eb1978f3fa58482e49f39cc7f595a59c34c57a40 # Parent b33fd23aa70792ccb8261c0d33dc3ef0ed7bc277 Modify the index to use windows.
Change the index screen to use MuttIndexWindow and MuttStatusWindow. diff --git a/curs_main.c b/curs_main.c --- a/curs_main.c +++ b/curs_main.c @@ -505,18 +505,16 @@ MUTTMENU *menu; char *cp; /* temporary variable. */ int index_hint; /* used to restore cursor position */ int do_buffy_notify = 1; int close = 0; /* did we OP_QUIT or OP_EXIT out of this menu? */ int attach_msg = option(OPTATTACHMSG); menu = mutt_new_menu (MENU_MAIN); - menu->offset = 1; - menu->pagelen = LINES - 3; menu->make_entry = index_make_entry; menu->color = index_color; menu->current = ci_first_message (); menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_MAIN, IndexHelp); if (!attach_msg) mutt_buffy_check(1); /* force the buffy check after we enter the folder */ @@ -626,19 +624,19 @@ menu_redraw_motion (menu); else if (menu->redraw & REDRAW_CURRENT) menu_redraw_current (menu); } if (menu->redraw & REDRAW_STATUS) { menu_status_line (buf, sizeof (buf), menu, NONULL (Status)); - move (option (OPTSTATUSONTOP) ? 0 : LINES-2, 0); + mutt_window_move (MuttStatusWindow, 0, 0); SETCOLOR (MT_COLOR_STATUS); - mutt_paddstr (COLS, buf); + mutt_paddstr (MuttStatusWindow->cols, buf); NORMAL_COLOR; menu->redraw &= ~REDRAW_STATUS; if (option(OPTTSENABLED) && TSSupported) { menu_status_line (buf, sizeof (buf), menu, NONULL (TSStatusFormat)); mutt_ts_status(buf); menu_status_line (buf, sizeof (buf), menu, NONULL (TSIconFormat)); mutt_ts_icon(buf); @@ -647,21 +645,22 @@ menu->redraw = 0; if (menu->current < menu->max) menu->oldcurrent = menu->current; else menu->oldcurrent = -1; if (option (OPTARROWCURSOR)) - move (menu->current - menu->top + menu->offset, 2); + mutt_window_move (MuttIndexWindow, menu->current - menu->top + menu->offset, 2); else if (option (OPTBRAILLEFRIENDLY)) - move (menu->current - menu->top + menu->offset, 0); + mutt_window_move (MuttIndexWindow, menu->current - menu->top + menu->offset, 0); else - move (menu->current - menu->top + menu->offset, COLS - 1); + mutt_window_move (MuttIndexWindow, menu->current - menu->top + menu->offset, + MuttIndexWindow->cols - 1); mutt_refresh (); #if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM) if (SigWinch) { mutt_flushinp (); mutt_resize_screen (); menu->redraw = REDRAW_FULL; @@ -698,24 +697,24 @@ if (!Context->tagged) { mutt_error _("No tagged messages."); continue; } tag = 1; /* give visual indication that the next command is a tag- command */ - mvaddstr (LINES - 1, 0, "tag-"); - clrtoeol (); + mutt_window_mvaddstr (MuttMessageWindow, 0, 0, "tag-"); + mutt_window_clrtoeol (MuttMessageWindow); /* get the real command */ if ((op = km_dokey (MENU_MAIN)) == OP_TAG_PREFIX) { /* abort tag sequence */ - CLEARLINE (LINES-1); + mutt_window_clearline (MuttMessageWindow, 0); continue; } } else if (option (OPTAUTOTAG) && Context && Context->tagged) tag = 1; if (op == OP_TAG_PREFIX_COND) { @@ -729,24 +728,24 @@ { mutt_flush_macro_to_endcond (); mutt_message _("Nothing to do."); continue; } tag = 1; /* give visual indication that the next command is a tag- command */ - mvaddstr (LINES - 1, 0, "tag-"); - clrtoeol (); + mutt_window_mvaddstr (MuttMessageWindow, 0, 0, "tag-"); + mutt_window_clrtoeol (MuttMessageWindow); /* get the real command */ if ((op = km_dokey (MENU_MAIN)) == OP_TAG_PREFIX) { /* abort tag sequence */ - CLEARLINE (LINES-1); + mutt_window_clearline (MuttMessageWindow, 0); continue; } } mutt_clear_error (); } else { @@ -1188,17 +1187,17 @@ op = OP_DISPLAY_MESSAGE; continue; } else break; } if (!buf[0]) { - CLEARLINE (LINES-1); + mutt_window_clearline (MuttMessageWindow, 0); break; } } mutt_expand_path (buf, sizeof (buf)); if (mx_get_magic (buf) <= 0) { mutt_error (_("%s is not a mailbox."), buf);
signature.asc
Description: PGP signature