Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Thu, 23 Feb 2006 08:05:37 +0000 (08:05 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Thu, 23 Feb 2006 08:05:37 +0000 (08:05 +0000)
- re-calculate sidebar boundaries upon non-interactive change of current folder

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@786 e385b8ad-14ed-0310-8656-cc95a2468c6d

VERSION.svn
sidebar.c

index 34d96ef..97e9e0c 100644 (file)
@@ -1 +1 @@
-785
+786
index 0a41ea5..cf940c3 100644 (file)
--- a/sidebar.c
+++ b/sidebar.c
@@ -33,9 +33,7 @@ static short initialized = 0;
 static short prev_show_value;
 
 /* computes first entry to be shown */
 static short prev_show_value;
 
 /* computes first entry to be shown */
-void calc_boundaries (int menu)
-{
-
+static void calc_boundaries (void) {
   if (list_empty(Incoming))
     return;
   if (CurBuffy < 0 || CurBuffy >= Incoming->length)
   if (list_empty(Incoming))
     return;
   if (CurBuffy < 0 || CurBuffy >= Incoming->length)
@@ -255,8 +253,10 @@ const char* sidebar_get_current (void) {
 /* internally sets item to buf */
 void sidebar_set_current (const char* buf) {
   int i = buffy_lookup (buf);
 /* internally sets item to buf */
 void sidebar_set_current (const char* buf) {
   int i = buffy_lookup (buf);
-  if (i >= 0)
+  if (i >= 0) {
     CurBuffy = i;
     CurBuffy = i;
+    calc_boundaries();
+  }
 }
 
 /* fix counters for a context
 }
 
 /* fix counters for a context
@@ -304,7 +304,7 @@ int sidebar_draw (int menu)
   }
 
   if (TopBuffy==0 || CurBuffy==0)
   }
 
   if (TopBuffy==0 || CurBuffy==0)
-    calc_boundaries(menu);
+    calc_boundaries();
 
   /* save or restore the value SidebarWidth */
   if (prev_show_value != option (OPTMBOXPANE)) {
 
   /* save or restore the value SidebarWidth */
   if (prev_show_value != option (OPTMBOXPANE)) {
@@ -460,6 +460,6 @@ void sidebar_scroll (int op, int menu) {
   default:
     return;
   }
   default:
     return;
   }
-  calc_boundaries (menu);
+  calc_boundaries ();
   sidebar_draw (menu);
 }
   sidebar_draw (menu);
 }