Commit af980ce8 authored by N.J. Mann's avatar N.J. Mann

Add next-folder command

parent 3a9996da
......@@ -107,6 +107,7 @@ OP_MAIN_FIRST_MESSAGE "move to the first message"
OP_MAIN_LAST_MESSAGE "move to the last message"
OP_MAIN_LIMIT "show only messages matching a pattern"
OP_MAIN_LINK_THREADS "link tagged message to the current one"
OP_MAIN_NEXT_FOLDER "open next folder with new mail"
OP_MAIN_NEXT_NEW "jump to the next new message"
OP_MAIN_NEXT_NEW_THEN_UNREAD "jump to the next new or unread message"
OP_MAIN_NEXT_SUBTHREAD "jump to the next subthread"
......
......@@ -1052,6 +1052,7 @@ int mutt_index_menu (void)
break;
case OP_MAIN_CHANGE_FOLDER:
case OP_MAIN_NEXT_FOLDER:
if (attach_msg)
op = OP_MAIN_CHANGE_FOLDER_READONLY;
......@@ -1066,22 +1067,36 @@ int mutt_index_menu (void)
cp = _("Open mailbox");
buf[0] = '\0';
mutt_buffy (buf, sizeof (buf));
if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
{
if (menu->menu == MENU_PAGER)
{
op = OP_DISPLAY_MESSAGE;
continue;
}
else
break;
}
if (!buf[0])
if ((op == OP_MAIN_NEXT_FOLDER) && Context && Context->path)
{
CLEARLINE (LINES-1);
break;
strfcpy (buf, Context->path, sizeof (buf));
mutt_pretty_mailbox (buf);
mutt_buffy (buf, sizeof (buf));
if (!buf[0])
{
mutt_error _("No new messages");
break;
}
}
else
{
mutt_buffy (buf, sizeof (buf));
if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
{
if (menu->menu == MENU_PAGER)
{
op = OP_DISPLAY_MESSAGE;
continue;
}
else
break;
}
if (!buf[0])
{
CLEARLINE (LINES-1);
break;
}
}
mutt_expand_path (buf, sizeof (buf));
......
......@@ -88,6 +88,7 @@ struct binding_t OpMain[] = { /* map: index */
{ "break-thread", OP_MAIN_BREAK_THREAD, "#" },
{ "change-folder", OP_MAIN_CHANGE_FOLDER, "c" },
{ "change-folder-readonly", OP_MAIN_CHANGE_FOLDER_READONLY, "\033c" },
{ "next-folder", OP_MAIN_NEXT_FOLDER, "," },
{ "collapse-thread", OP_MAIN_COLLAPSE_THREAD, "\033v" },
{ "collapse-all", OP_MAIN_COLLAPSE_ALL, "\033V" },
{ "copy-message", OP_COPY_MESSAGE, "C" },
......@@ -176,6 +177,7 @@ struct binding_t OpPager[] = { /* map: pager */
{ "bounce-message", OP_BOUNCE_MESSAGE, "b" },
{ "change-folder", OP_MAIN_CHANGE_FOLDER, "c" },
{ "change-folder-readonly", OP_MAIN_CHANGE_FOLDER_READONLY, "\033c" },
{ "next-folder", OP_MAIN_NEXT_FOLDER, "," },
{ "copy-message", OP_COPY_MESSAGE, "C" },
{ "decode-copy", OP_DECODE_COPY, "\033C" },
{ "delete-message", OP_DELETE, "d" },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment