]> granicus.if.org Git - neomutt/commitdiff
Change sidebar highlighted mailbox behavior.
authorKevin McCarthy <kevin@8t8.us>
Sat, 9 Jul 2016 01:52:56 +0000 (18:52 -0700)
committerKevin McCarthy <kevin@8t8.us>
Sat, 9 Jul 2016 01:52:56 +0000 (18:52 -0700)
Delay selecting the highlighted mailbox until prepare_mailbox(), to
avoid a hidden mailbox being selected during the Buffy list population
(in mutt_sb_notify_mailbox()).

Change update_entries_visibility() to not automatically make the
highlighted mailbox visible.

Change prepare_sidebar() to (re)set the highlighted mailbox when the
current highlighted mailbox is hidden.

sidebar.c

index e710b672736cc6d4925fb1129eca6465ca9cb968..9169fca76569d2ee64e8ba18fc8e0028da4cc4ea 100644 (file)
--- a/sidebar.c
+++ b/sidebar.c
@@ -303,7 +303,7 @@ static void update_entries_visibility (void)
       continue;
 
     if ((i == OpnIndex) || (sbe->buffy->msg_unread  > 0) || sbe->buffy->new ||
-        (i == HilIndex) || (sbe->buffy->msg_flagged > 0))
+        (sbe->buffy->msg_flagged > 0))
       continue;
 
     if (Context && (mutt_strcmp (sbe->buffy->realpath, Context->realpath) == 0))
@@ -410,7 +410,8 @@ static int prepare_sidebar (int page_size)
       HilIndex = i;
   }
 
-  if ((HilIndex < 0) || (SidebarSortMethod != PreviousSort))
+  if ((HilIndex < 0) || Entries[HilIndex]->is_hidden ||
+      (SidebarSortMethod != PreviousSort))
   {
     if (OpnIndex >= 0)
       HilIndex = OpnIndex;
@@ -1008,8 +1009,6 @@ void mutt_sb_notify_mailbox (BUFFY *b, int created)
 
     if (TopIndex < 0)
       TopIndex = EntryCount;
-    if (HilIndex < 0)
-      HilIndex = EntryCount;
     if (BotIndex < 0)
       BotIndex = EntryCount;
     if ((OpnIndex < 0) && Context &&