summaryrefslogtreecommitdiffstats
path: root/browser.c
diff options
context:
space:
mode:
authorDmitri Vereshchagin <dmitri.vereshchagin@gmail.com>2017-03-12 10:54:58 -0700
committerDmitri Vereshchagin <dmitri.vereshchagin@gmail.com>2017-03-12 10:54:58 -0700
commit8328ce686c396626eb97f23aba74fccdabe8906c (patch)
tree7a463f8cd8cc5001c218185d2fafbc0eeb31c693 /browser.c
parent37c311e42d5d9667592b8e2bf35c5d8e36e19085 (diff)
Add shortcuts for IMAP and POP mailboxes in the file browser
Mailbox list may not be properly displayed in a standard 80-column terminal window if the $folder variable contains a long URL. In such a case only left part of each entry name can be visible with the default value of $folder_format. What's worse, this visible part may not be enough to distinguish between the entries. Thus in this case mutt_pretty_mailbox() will be just as useful as for local mailboxes.
Diffstat (limited to 'browser.c')
-rw-r--r--browser.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/browser.c b/browser.c
index b9908b40..1fca7d9a 100644
--- a/browser.c
+++ b/browser.c
@@ -492,17 +492,20 @@ static int examine_mailboxes (MUTTMENU *menu, struct browser_state *state)
tmp->msg_unread = Context->unread;
}
+ strfcpy (buffer, NONULL (tmp->path), sizeof (buffer));
+ mutt_pretty_mailbox (buffer, sizeof (buffer));
+
#ifdef USE_IMAP
if (mx_is_imap (tmp->path))
{
- add_folder (menu, state, tmp->path, NULL, tmp);
+ add_folder (menu, state, buffer, NULL, tmp);
continue;
}
#endif
#ifdef USE_POP
if (mx_is_pop (tmp->path))
{
- add_folder (menu, state, tmp->path, NULL, tmp);
+ add_folder (menu, state, buffer, NULL, tmp);
continue;
}
#endif
@@ -528,9 +531,6 @@ static int examine_mailboxes (MUTTMENU *menu, struct browser_state *state)
s.st_mtime = st2.st_mtime;
}
- strfcpy (buffer, NONULL(tmp->path), sizeof (buffer));
- mutt_pretty_mailbox (buffer, sizeof (buffer));
-
add_folder (menu, state, buffer, &s, tmp);
}
while ((tmp = tmp->next));