Commit f1a47a2a authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: reshuffle a few things to reduce duplication

It is no longer necessary to assign up() and down() separately for
the help viewer because by now the movement keys have been sorted
in order of ascending stride also in the main menu.

The two string definitions are relocated just to reduce the number
of #ifdefs.
No related merge requests found
Showing with 5 additions and 14 deletions
+5 -14
...@@ -493,11 +493,8 @@ void shortcut_init(void) ...@@ -493,11 +493,8 @@ void shortcut_init(void)
const char *whereis_next_tag = N_("WhereIs Next"); const char *whereis_next_tag = N_("WhereIs Next");
#ifdef ENABLE_HELP #ifdef ENABLE_HELP
#ifndef DISABLE_JUSTIFY
/* TRANSLATORS: The next long series of strings are shortcut descriptions; /* TRANSLATORS: The next long series of strings are shortcut descriptions;
* they are best kept shorter than 56 characters, but may be longer. */ * they are best kept shorter than 56 characters, but may be longer. */
const char *nano_justify_msg = N_("Justify the current paragraph");
#endif
const char *nano_cancel_msg = N_("Cancel the current function"); const char *nano_cancel_msg = N_("Cancel the current function");
const char *nano_help_msg = N_("Display this help text"); const char *nano_help_msg = N_("Display this help text");
const char *nano_exit_msg = const char *nano_exit_msg =
...@@ -589,6 +586,7 @@ void shortcut_init(void) ...@@ -589,6 +586,7 @@ void shortcut_init(void)
N_("Cut from the cursor position to the end of the file"); N_("Cut from the cursor position to the end of the file");
#endif #endif
#ifndef DISABLE_JUSTIFY #ifndef DISABLE_JUSTIFY
const char *nano_justify_msg = N_("Justify the current paragraph");
const char *nano_fulljustify_msg = N_("Justify the entire file"); const char *nano_fulljustify_msg = N_("Justify the entire file");
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
...@@ -623,9 +621,6 @@ void shortcut_init(void) ...@@ -623,9 +621,6 @@ void shortcut_init(void)
const char *nano_next_history_msg = const char *nano_next_history_msg =
N_("Recall the next search/replace string"); N_("Recall the next search/replace string");
#endif #endif
#ifdef ENABLE_BROWSER
const char *nano_tofiles_msg = N_("Go to file browser");
#endif
#ifndef NANO_TINY #ifndef NANO_TINY
const char *nano_dos_msg = N_("Toggle the use of DOS format"); const char *nano_dos_msg = N_("Toggle the use of DOS format");
const char *nano_mac_msg = N_("Toggle the use of Mac format"); const char *nano_mac_msg = N_("Toggle the use of Mac format");
...@@ -639,6 +634,7 @@ void shortcut_init(void) ...@@ -639,6 +634,7 @@ void shortcut_init(void)
#endif #endif
const char *nano_discard_buffer_msg = N_("Close buffer without saving it"); const char *nano_discard_buffer_msg = N_("Close buffer without saving it");
#ifdef ENABLE_BROWSER #ifdef ENABLE_BROWSER
const char *nano_tofiles_msg = N_("Go to file browser");
const char *nano_exitbrowser_msg = N_("Exit from the file browser"); const char *nano_exitbrowser_msg = N_("Exit from the file browser");
const char *nano_firstfile_msg = N_("Go to the first file in the list"); const char *nano_firstfile_msg = N_("Go to the first file in the list");
const char *nano_lastfile_msg = N_("Go to the last file in the list"); const char *nano_lastfile_msg = N_("Go to the last file in the list");
...@@ -671,7 +667,7 @@ void shortcut_init(void) ...@@ -671,7 +667,7 @@ void shortcut_init(void)
add_to_funcs(do_cancel, ((MMOST & ~MMAIN & ~MBROWSER) | MYESNO), add_to_funcs(do_cancel, ((MMOST & ~MMAIN & ~MBROWSER) | MYESNO),
N_("Cancel"), IFSCHELP(nano_cancel_msg), BLANKAFTER, VIEW); N_("Cancel"), IFSCHELP(nano_cancel_msg), BLANKAFTER, VIEW);
add_to_funcs(do_exit, MMAIN, add_to_funcs(do_exit, MMAIN|MHELP,
exit_tag, IFSCHELP(nano_exit_msg), TOGETHER, VIEW); exit_tag, IFSCHELP(nano_exit_msg), TOGETHER, VIEW);
/* Remember the entry for Exit, to be able to replace it with Close. */ /* Remember the entry for Exit, to be able to replace it with Close. */
exitfunc = tailfunc; exitfunc = tailfunc;
...@@ -724,15 +720,10 @@ void shortcut_init(void) ...@@ -724,15 +720,10 @@ void shortcut_init(void)
#ifdef ENABLE_HELP #ifdef ENABLE_HELP
/* The description ("x") and blank_after (0) are irrelevant, /* The description ("x") and blank_after (0) are irrelevant,
* because the help viewer does not have a help text. */ * because the help viewer does not have a help text. */
add_to_funcs(do_exit, MHELP, exit_tag, "x", 0, VIEW);
add_to_funcs(total_refresh, MHELP, refresh_tag, "x", 0, VIEW); add_to_funcs(total_refresh, MHELP, refresh_tag, "x", 0, VIEW);
add_to_funcs(do_search, MHELP, whereis_tag, "x", 0, VIEW); add_to_funcs(do_search, MHELP, whereis_tag, "x", 0, VIEW);
add_to_funcs(do_research, MHELP, whereis_next_tag, "x", 0, VIEW); add_to_funcs(do_research, MHELP, whereis_next_tag, "x", 0, VIEW);
add_to_funcs(do_up_void, MHELP, prev_line_tag, "x", 0, VIEW);
add_to_funcs(do_down_void, MHELP, next_line_tag, "x", 0, VIEW);
#endif #endif
add_to_funcs(do_cut_text_void, MMAIN, add_to_funcs(do_cut_text_void, MMAIN,
...@@ -841,9 +832,9 @@ void shortcut_init(void) ...@@ -841,9 +832,9 @@ void shortcut_init(void)
add_to_funcs(do_end_void, MMAIN, add_to_funcs(do_end_void, MMAIN,
N_("End"), IFSCHELP(nano_end_msg), BLANKAFTER, VIEW); N_("End"), IFSCHELP(nano_end_msg), BLANKAFTER, VIEW);
add_to_funcs(do_up_void, MMAIN|MBROWSER, add_to_funcs(do_up_void, MMAIN|MHELP|MBROWSER,
prev_line_tag, IFSCHELP(nano_prevline_msg), TOGETHER, VIEW); prev_line_tag, IFSCHELP(nano_prevline_msg), TOGETHER, VIEW);
add_to_funcs(do_down_void, MMAIN|MBROWSER, add_to_funcs(do_down_void, MMAIN|MHELP|MBROWSER,
next_line_tag, IFSCHELP(nano_nextline_msg), TOGETHER, VIEW); next_line_tag, IFSCHELP(nano_nextline_msg), TOGETHER, VIEW);
#ifndef NANO_TINY #ifndef NANO_TINY
add_to_funcs(do_scroll_up, MMAIN, add_to_funcs(do_scroll_up, MMAIN,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment