From d934da7072628e5ad97f97fc4c51ca99e3d8c323 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 17 Feb 2019 21:02:29 +0100 Subject: [PATCH 6/8] menus: don't show ^S and ^Q in the help lines in the tiny version On small terminals (80 columns or so), ^S and ^Q would be in the last position of the help lines. But some terminals might intercept ^S and stop all output (until ^Q is pressed), which could be unexpected and frustrating. So, rearrange things for the tiny version so that ^S appears only on very wide terminals. Also, having two keystrokes for saving the current buffer (^O and ^S) in the two help lines is wasteful, more so as in the tiny version there are no ^G help texts. So, show the more useful M-Q and M-W instead. This addresses https://bugs.debian.org/915017. Reported-by: Steve McIntyre --- src/global.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/global.c b/src/global.c index 611649d6..018b0d3e 100644 --- a/src/global.c +++ b/src/global.c @@ -835,10 +835,6 @@ void shortcut_init(void) #ifndef NANO_TINY add_to_funcs(do_find_bracket, MMAIN, N_("To Bracket"), WITHORSANS(bracket_gist), BLANKAFTER, VIEW); -#else - /* Place this one here only in the tiny version; otherwise further down. */ - add_to_funcs(do_savefile, MMAIN, - N_("Save"), WITHORSANS(savefile_gist), BLANKAFTER, NOVIEW); #endif #ifdef ENABLE_BROWSER @@ -847,14 +843,28 @@ void shortcut_init(void) add_to_funcs(do_search_backward, MBROWSER, N_("Where Was"), WITHORSANS(browserwherewas_gist), TOGETHER, VIEW); #endif + +#ifndef NANO_TINY add_to_funcs(do_search_backward, MMAIN|MHELP, /* TRANSLATORS: This starts a backward search. */ N_("Where Was"), WITHORSANS(wherewas_gist), TOGETHER, VIEW); +#endif add_to_funcs(do_findprevious, MMAIN|MHELP|MBROWSER, /* TRANSLATORS: This refers to searching the preceding occurrence. */ N_("Previous"), WITHORSANS(findprev_gist), TOGETHER, VIEW); +#ifndef NANO_TINY add_to_funcs(do_findnext, MMAIN|MHELP|MBROWSER, N_("Next"), WITHORSANS(findnext_gist), BLANKAFTER, VIEW); +#else + /* In the tiny version, arrange things a bit differently, so that + * the useful M-W and M-Q are shown in the help lines. */ + add_to_funcs(do_findnext, MMAIN|MHELP|MBROWSER, + N_("Next"), WITHORSANS(findnext_gist), TOGETHER, VIEW); + add_to_funcs(do_search_backward, MMAIN|MHELP, + N_("Where Was"), WITHORSANS(wherewas_gist), BLANKAFTER, VIEW); + add_to_funcs(total_refresh, MMAIN, + N_("Refresh"), WITHORSANS(refresh_gist), BLANKAFTER, VIEW); +#endif add_to_funcs(do_left, MMAIN, /* TRANSLATORS: This means move the cursor one character back. */ @@ -962,8 +972,10 @@ void shortcut_init(void) add_to_funcs(do_verbatim_input, MMAIN, N_("Verbatim"), WITHORSANS(verbatim_gist), BLANKAFTER, NOVIEW); +#ifndef NANO_TINY add_to_funcs(total_refresh, MMAIN, N_("Refresh"), WITHORSANS(refresh_gist), TOGETHER, VIEW); +#endif add_to_funcs(do_suspend_void, MMAIN, N_("Suspend"), WITHORSANS(suspend_gist), BLANKAFTER, VIEW); @@ -995,10 +1007,10 @@ void shortcut_init(void) if (!ISSET(RESTRICTED)) add_to_funcs(do_linter, MMAIN, N_("To Linter"), WITHORSANS(lint_gist), BLANKAFTER, NOVIEW); +#endif #endif add_to_funcs(do_savefile, MMAIN, N_("Save"), WITHORSANS(savefile_gist), BLANKAFTER, NOVIEW); -#endif #ifndef ENABLE_JUSTIFY add_to_funcs(flip_goto, MWHEREIS, -- 2.20.1