From 9767f8164a8651c26be02fbea4876000ed3aaa51 Mon Sep 17 00:00:00 2001 From: pdmef Date: Mon, 20 Feb 2006 16:38:10 +0000 Subject: [PATCH] Rocco Rutte: - yet another sidebar scrolling fix git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@785 e385b8ad-14ed-0310-8656-cc95a2468c6d --- VERSION.svn | 2 +- do-commit.sh | 6 +++++- sidebar.c | 14 +++++++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/VERSION.svn b/VERSION.svn index 3aedf24..34d96ef 100644 --- a/VERSION.svn +++ b/VERSION.svn @@ -1 +1 @@ -784 +785 diff --git a/do-commit.sh b/do-commit.sh index 1376de8..4cb7e7c 100755 --- a/do-commit.sh +++ b/do-commit.sh @@ -1,4 +1,8 @@ #!/bin/sh svn update echo "`svn info | awk -F': ' '/^Revision: / {print $2}'`+1" | bc > ./VERSION.svn -svn commit "$@" +if [ x"$1" != x ] ; then + svn commit do-commit.sh VERSION.svn "$@" +else + svn commit +fi diff --git a/sidebar.c b/sidebar.c index a0b888f..0a41ea5 100644 --- a/sidebar.c +++ b/sidebar.c @@ -35,7 +35,6 @@ static short prev_show_value; /* computes first entry to be shown */ void calc_boundaries (int menu) { - int lines = 0; if (list_empty(Incoming)) return; @@ -44,8 +43,6 @@ void calc_boundaries (int menu) if (TopBuffy < 0 || TopBuffy >= Incoming->length) TopBuffy = 0; - lines = LINES - 2 - !option (OPTHELP); - known_lines = lines; if (option (OPTSIDEBARNEWMAILONLY)) { int i = CurBuffy; TopBuffy = CurBuffy - 1; @@ -55,7 +52,7 @@ void calc_boundaries (int menu) i--; } } else - TopBuffy = CurBuffy - (CurBuffy % lines); + TopBuffy = CurBuffy - (CurBuffy % known_lines); if (TopBuffy < 0) TopBuffy = 0; } @@ -296,6 +293,8 @@ int sidebar_draw (int menu) last_line -= 1-(menu==MENU_PAGER); } + known_lines=last_line-first_line; + /* initialize first time */ if (!initialized) { prev_show_value = option (OPTMBOXPANE); @@ -304,6 +303,9 @@ int sidebar_draw (int menu) initialized = 1; } + if (TopBuffy==0 || CurBuffy==0) + calc_boundaries(menu); + /* save or restore the value SidebarWidth */ if (prev_show_value != option (OPTMBOXPANE)) { if (!prev_show_value && option (OPTMBOXPANE)) { @@ -343,11 +345,9 @@ int sidebar_draw (int menu) if (list_empty(Incoming)) return 0; - line = first_line; - calc_boundaries (menu); /* actually print items */ - for (i = TopBuffy; i < Incoming->length && line < last_line; i++) { + for (i = TopBuffy, line=first_line; i < Incoming->length && line < last_line; i++) { tmp = (BUFFY*) Incoming->data[i]; if (i == CurBuffy) -- 2.20.1