diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-01-11 22:31:40 +0000 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-01-11 22:31:40 +0000 |
commit | 521511aa9379b5d89890554254144cf18e5bcc64 (patch) | |
tree | c06c964fe059472c4c3002a5ea0134be9383e295 | |
parent | c8af480f52b46e556d23ef012f3987aa3a0fc25b (diff) | |
download | calcurse-521511aa9379b5d89890554254144cf18e5bcc64.tar.gz calcurse-521511aa9379b5d89890554254144cf18e5bcc64.zip |
Code cleanup and fixed compiler warning.
-rwxr-xr-x | ChangeLog | 4 | ||||
-rwxr-xr-x | src/help.c | 60 |
2 files changed, 34 insertions, 30 deletions
@@ -1,5 +1,9 @@ 2011-01-11 Lukas Fleischer <calcurse@cryptocrack.de> + * src/help.c: Code cleanup and fixed compiler warning. + +2011-01-11 Lukas Fleischer <calcurse@cryptocrack.de> + * src/calcurse.h * src/utils.c: Make parse_date accept several short forms, e.g. "1/1/30" for "01/01/2030", "26" for the 26th of the currently @@ -1,4 +1,4 @@ -/* $calcurse: help.c,v 1.44 2010/03/21 10:17:03 culot Exp $ */ +/* $calcurse: help.c,v 1.45 2011/01/11 22:31:40 fleischer Exp $ */ /* * Calcurse - text-based organizer @@ -743,36 +743,36 @@ help_screen (void) { erase_window_part (hwin.win.p, 1, hwin.pad.y, col - 2, hwin.win.h - 2); - switch (ch) - { - case KEY_RESIZE: - wins_get_config (); - help_wins_reset (&hwin); - hwin.first_visible_line = 0; - hwin.total_lines = help_write_pad (&hwin.pad, hscr[oldpage].title, - hscr[oldpage].text, ch); - need_resize = 1; - break; - - case KEY_GENERIC_SCROLL_DOWN: - wins_scrollwin_down (&hwin, 1); - break; - - case KEY_GENERIC_SCROLL_UP: - wins_scrollwin_up (&hwin, 1); - break; - - default: - page = wanted_page (ch); - if (page != NOPAGE) - { - hwin.first_visible_line = 0; - hwin.total_lines = help_write_pad (&hwin.pad, hscr[page].title, + + if ((int) ch == KEY_RESIZE) { + wins_get_config (); + help_wins_reset (&hwin); + hwin.first_visible_line = 0; + hwin.total_lines = help_write_pad (&hwin.pad, hscr[oldpage].title, + hscr[oldpage].text, ch); + need_resize = 1; + } + else { + switch (ch) { + case KEY_GENERIC_SCROLL_DOWN: + wins_scrollwin_down (&hwin, 1); + break; + + case KEY_GENERIC_SCROLL_UP: + wins_scrollwin_up (&hwin, 1); + break; + + default: + page = wanted_page (ch); + if (page != NOPAGE) { + hwin.first_visible_line = 0; + hwin.total_lines = help_write_pad (&hwin.pad, hscr[page].title, hscr[page].text, ch); - oldpage = page; - } - break; - } + oldpage = page; + } + } + } + wins_scrollwin_display (&hwin); ch = keys_getch (win[STA].p); } |