From: Richard Russon Date: Thu, 14 Apr 2016 20:12:58 +0000 (+0100) Subject: try hard to keep track of the open mailbox X-Git-Tag: neomutt-20160416~5^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb7fa4fad9ecbe028df29a11e3fc565c64c0014a;p=neomutt try hard to keep track of the open mailbox If a user deletes the current mailbox with "unmailboxes", but then adds it back with "mailboxes", then we will highlight it correctly. --- diff --git a/sidebar.c b/sidebar.c index 780e5cb08..0a2199381 100644 --- a/sidebar.c +++ b/sidebar.c @@ -1071,6 +1071,13 @@ sb_notify_mailbox (BUFFY *b, int created) BotBuffy = b; if (!Outgoing) Outgoing = b; + if (!OpnBuffy && Context) { + /* This might happen if the user "unmailboxes *", then + * "mailboxes" our current mailbox back again */ + if (mutt_strcmp (b->path, Context->path) == 0) { + OpnBuffy = b; + } + } } else { if (TopBuffy == b) TopBuffy = buffy_going (TopBuffy);