aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2006-09-17 18:24:39 +0000
committerFrederic Culot <calcurse@culot.org>2006-09-17 18:24:39 +0000
commit06710ea0c08b8b762b3924cf04efb9641f70a2fd (patch)
tree9b997cda2f44b04e6cd3cb06a037a1785c2f49d0
parent5027e48b9117ef69b4ba896c3bdd8a16c3a8622a (diff)
downloadcalcurse-06710ea0c08b8b762b3924cf04efb9641f70a2fd.tar.gz
calcurse-06710ea0c08b8b762b3924cf04efb9641f70a2fd.zip
bugfix in help_screen(): text_lines is now correctly updated
-rwxr-xr-xsrc/help.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/help.c b/src/help.c
index 8cd7bb6..832f08f 100755
--- a/src/help.c
+++ b/src/help.c
@@ -1,4 +1,4 @@
-/* $calcurse: help.c,v 1.8 2006/09/17 11:16:37 culot Exp $ */
+/* $calcurse: help.c,v 1.9 2006/09/17 18:24:39 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -75,11 +75,10 @@ void help_screen(int which_pan, int colr)
WINDOW *help_pad = NULL;
char label[80];
int ch = '?';
- int help_row;
+ int help_row, text_lines;
int help_col = col;
int title_lines = 3;
int pad_offset = 4;
- int text_lines = help_row - (pad_offset + 1);
int pad_width = help_col - 2*pad_offset + 1;
int first_line = 0, nl = 0;
@@ -317,6 +316,7 @@ void help_screen(int which_pan, int colr)
* the scrolling faster.
*/
help_row = (notify_bar()) ? row - 3 : row - 2;
+ text_lines = help_row - (pad_offset + 1);
help_win = newwin(help_row, help_col, 0, 0);
help_pad = newpad(MAX_LENGTH, pad_width);
box(help_win, 0, 0);
@@ -439,6 +439,8 @@ void help_screen(int which_pan, int colr)
int highend = (int) (ratio * first_line);
int sbar_top = highend + title_lines + 1;
+ if ((sbar_top + sbar_length) > help_row - 1)
+ sbar_length = help_row - 1 -sbar_top;
draw_scrollbar(help_win, sbar_top, help_col - 2,
sbar_length, title_lines + 1,
help_row - 1, true);