From: Pietro Cerutti Date: Thu, 29 Nov 2018 09:30:30 +0000 (+0000) Subject: Fix unsub from the selected mailbox by just hiding it X-Git-Tag: 2019-10-25~477 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cf90287291386386d0377417257e7eedbe073a37;p=neomutt Fix unsub from the selected mailbox by just hiding it Fixes #1460 --- diff --git a/mailbox.c b/mailbox.c index 8c6c8c63e..b635f1553 100644 --- a/mailbox.c +++ b/mailbox.c @@ -525,9 +525,16 @@ int mutt_parse_unmailboxes(struct Buffer *buf, struct Buffer *s, #ifdef USE_INOTIFY mutt_monitor_remove(np->m); #endif - mx_ac_remove(np->m); + if (Context->mailbox == np->m) + { + np->m->flags |= MB_HIDDEN; + } + else + { + mx_ac_remove(np->m); + mailbox_free(&np->m); + } STAILQ_REMOVE(&AllMailboxes, np, MailboxNode, entries); - mailbox_free(&np->m); FREE(&np); continue; }