nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] [PATCH] menus: don't show ^S and ^Q in the help lines in th


From: Benno Schulenberg
Subject: [Nano-devel] [PATCH] menus: don't show ^S and ^Q in the help lines in the tiny version
Date: Mon, 18 Feb 2019 08:32:46 +0100

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.
---
 src/global.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/global.c b/src/global.c
index d47067e7..7c86502b 100644
--- a/src/global.c
+++ b/src/global.c
@@ -827,10 +827,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
@@ -839,15 +835,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. 
*/
                N_("Back"), WITHORSANS(back_gist), TOGETHER, VIEW);
@@ -954,8 +963,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);
@@ -987,10 +998,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
 
        add_to_funcs(flip_goto, MGOTOLINE,
                N_("Go To Text"), WITHORSANS(whereis_gist), BLANKAFTER, VIEW);
-- 
2.20.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]