From 89c7472ecb566c4cbe9c0022515feeda02fabf79 Mon Sep 17 00:00:00 2001 From: pdmef Date: Thu, 23 Feb 2006 08:05:37 +0000 Subject: [PATCH] Rocco Rutte: - 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 | 2 +- sidebar.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/VERSION.svn b/VERSION.svn index 34d96ef..97e9e0c 100644 --- a/VERSION.svn +++ b/VERSION.svn @@ -1 +1 @@ -785 +786 diff --git a/sidebar.c b/sidebar.c index 0a41ea5..cf940c3 100644 --- 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 */ -void calc_boundaries (int menu) -{ - +static void calc_boundaries (void) { 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); - if (i >= 0) + if (i >= 0) { CurBuffy = i; + calc_boundaries(); + } } /* fix counters for a context @@ -304,7 +304,7 @@ int sidebar_draw (int menu) } if (TopBuffy==0 || CurBuffy==0) - calc_boundaries(menu); + calc_boundaries(); /* 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; } - calc_boundaries (menu); + calc_boundaries (); sidebar_draw (menu); } -- 2.20.1