From: David Lawrence Ramsey Date: Thu, 11 Nov 2004 21:50:01 +0000 (+0000) Subject: in handle_sigwinch(), call shortcut_init(FALSE) defore redisplaying the X-Git-Tag: v1.3.5~30 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=1f1ebb85b7722e90452c4e73e8b8cce1f1f23627;p=nano.git in handle_sigwinch(), call shortcut_init(FALSE) defore redisplaying the main list, so that "UnJustify" isn't erroneously displayed when we justify, suspend, and then continue; also add a few last cosmetic fixes git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2090 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index bf43c6b2..d5f904b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -227,6 +227,10 @@ CVS code - - Make goal a ssize_t instead of an int, since fill is now a ssize_t, and the position at which a line is broken can be greater than COLS. (DLR) + handle_sigwinch() + - Call shortcut_init(FALSE) defore redisplaying the main list, + so that "UnJustify" isn't erroneously displayed when we + justify, suspend, and then continue. (DLR) main() - Tweak the command line parsing routine so that multiple +LINE flags are properly interpreted in multibuffer mode. (DLR) diff --git a/src/global.c b/src/global.c index b17b5ecb..2a343ff2 100644 --- a/src/global.c +++ b/src/global.c @@ -224,7 +224,7 @@ void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc, s->next = NULL; } -void shortcut_init(int unjustify) +void shortcut_init(bool unjustify) { const char *get_help_msg = N_("Get Help"); const char *exit_msg = N_("Exit"); diff --git a/src/nano.c b/src/nano.c index 116d5ad8..ab87e7c1 100644 --- a/src/nano.c +++ b/src/nano.c @@ -388,7 +388,8 @@ void help_init(void) /* The space needed for the shortcut lists, at most COLS characters, * plus '\n'. */ - allocsize += (COLS < 21 ? 21 : COLS + 1) * length_of_list(currshortcut); + allocsize += (COLS < 21 ? 21 : COLS + 1) * + length_of_list(currshortcut); #ifndef NANO_SMALL /* If we're on the main list, we also count the toggle help text. @@ -400,7 +401,7 @@ void help_init(void) for (t = toggles; t != NULL; t = t->next) allocsize += 8 + strlen(t->desc) + endislen; } -#endif /* !NANO_SMALL */ +#endif /* help_text has been freed and set to NULL unless the user resized * while in the help screen. */ @@ -3088,8 +3089,10 @@ void handle_sigwinch(int s) * dimensions. */ window_init(); - /* Redraw the contents of the windows that need it. */ + /* Redraw the contents of the windows that need it, and display the + * shortcut list with UnCut. */ blank_statusbar(); + shortcut_init(FALSE); display_main_list(); total_refresh(); diff --git a/src/proto.h b/src/proto.h index 0f409c8d..3bf021e0 100644 --- a/src/proto.h +++ b/src/proto.h @@ -263,7 +263,7 @@ void sc_init_one(shortcut **shortcutage, int key, const char *desc, #endif int metaval, int funcval, int miscval, int view, void (*func)(void)); -void shortcut_init(int unjustify); +void shortcut_init(bool unjustify); void free_shortcutage(shortcut **shortcutage); #ifdef DEBUG void thanks_for_all_the_fish(void);