]> granicus.if.org Git - neomutt/commitdiff
try hard to keep track of the open mailbox
authorRichard Russon <rich@flatcap.org>
Thu, 14 Apr 2016 20:12:58 +0000 (21:12 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 14 Apr 2016 20:12:58 +0000 (21:12 +0100)
If a user deletes the current mailbox with "unmailboxes", but then adds
it back with "mailboxes", then we will highlight it correctly.

sidebar.c

index 780e5cb0800744f3975cab02ae8dfa01dc00a949..0a2199381c9dde0f2d5b5127131c258137af189b 100644 (file)
--- 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);