Commit 1df3e2d0 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

reorganize the main shortcut list to make it easier for new users, per

Benno Schulenberg's suggestion


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3410 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 312 additions and 319 deletions
+312 -319
...@@ -78,6 +78,16 @@ CVS code - ...@@ -78,6 +78,16 @@ CVS code -
(Meta-?). Also, make sure all the equivalent shortcuts in the (Meta-?). Also, make sure all the equivalent shortcuts in the
search, replace, and "Go To Line" lists accept both the meta search, replace, and "Go To Line" lists accept both the meta
keys and the equivalent function keys. (DLR) keys and the equivalent function keys. (DLR)
- Reorganize the main shortcut list to make it easier for new
users. It now lists the twelve Pico-compatible default
operations, followed by search and replace shortcuts, followed
by cut and paste shortcuts, followed by marking shortcuts,
followed by back and forth movement shortcuts, followed by
start and end movement shortcuts, followed by buffer-switching
shortcuts, followed by insertion and deletion shortcuts,
followed by special movement shortcuts, followed by advanced
word and paragraph shortcuts, followed by display shortcuts.
(DLR, suggested by Benno Schulenberg)
toggle_init() toggle_init()
- In the global toggle list, move the "Constant cursor position - In the global toggle list, move the "Constant cursor position
display" toggle up to after the "Use more space for editing" display" toggle up to after the "Use more space for editing"
......
...@@ -223,8 +223,8 @@ void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc, ...@@ -223,8 +223,8 @@ void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
const char *help, const char *help,
#endif #endif
int metaval, int funcval, int miscval, bool view, void bool blank_after, int metaval, int funcval, int miscval, bool
(*func)(void)) view, void (*func)(void))
{ {
shortcut *s; shortcut *s;
...@@ -243,6 +243,7 @@ void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc, ...@@ -243,6 +243,7 @@ void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
s->help = (help == NULL) ? "" : _(help); s->help = (help == NULL) ? "" : _(help);
#endif #endif
s->blank_after = blank_after;
s->metaval = metaval; s->metaval = metaval;
s->funcval = funcval; s->funcval = funcval;
s->miscval = miscval; s->miscval = miscval;
...@@ -432,8 +433,8 @@ void shortcut_init(bool unjustify) ...@@ -432,8 +433,8 @@ void shortcut_init(bool unjustify)
#endif /* !DISABLE_HELP */ #endif /* !DISABLE_HELP */
/* The following macro is to be used in calling sc_init_one(). The /* The following macro is to be used in calling sc_init_one(). The
* point is that sc_init_one() takes 9 arguments, unless DISABLE_HELP is * point is that sc_init_one() takes 10 arguments, unless DISABLE_HELP
* defined, when the 4th one should not be there. */ * is defined, when the 4th one should not be there. */
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
#define IFHELP(help, nextvar) help, nextvar #define IFHELP(help, nextvar) help, nextvar
#else #else
...@@ -443,8 +444,8 @@ void shortcut_init(bool unjustify) ...@@ -443,8 +444,8 @@ void shortcut_init(bool unjustify)
free_shortcutage(&main_list); free_shortcutage(&main_list);
sc_init_one(&main_list, NANO_HELP_KEY, get_help_msg, sc_init_one(&main_list, NANO_HELP_KEY, get_help_msg,
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY,
VIEW, NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
do_help_void do_help_void
#else #else
...@@ -457,17 +458,17 @@ void shortcut_init(bool unjustify) ...@@ -457,17 +458,17 @@ void shortcut_init(bool unjustify)
/* TRANSLATORS: Try to keep this at most 10 characters. */ /* TRANSLATORS: Try to keep this at most 10 characters. */
openfile != NULL && openfile != openfile->next ? N_("Close") : openfile != NULL && openfile != openfile->next ? N_("Close") :
#endif #endif
exit_msg, IFHELP(nano_exit_msg, NANO_NO_KEY), NANO_EXIT_FKEY, exit_msg, IFHELP(nano_exit_msg, FALSE), NANO_NO_KEY),
NANO_NO_KEY, VIEW, do_exit); NANO_EXIT_FKEY, NANO_NO_KEY, VIEW, do_exit);
/* TRANSLATORS: Try to keep this at most 10 characters. */ /* TRANSLATORS: Try to keep this at most 10 characters. */
sc_init_one(&main_list, NANO_WRITEOUT_KEY, N_("WriteOut"), sc_init_one(&main_list, NANO_WRITEOUT_KEY, N_("WriteOut"),
IFHELP(nano_writeout_msg, NANO_NO_KEY), NANO_WRITEOUT_FKEY, IFHELP(nano_writeout_msg, FALSE), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, do_writeout_void); NANO_WRITEOUT_FKEY, NANO_NO_KEY, NOVIEW, do_writeout_void);
/* TRANSLATORS: Try to keep this at most 10 characters. */ /* TRANSLATORS: Try to keep this at most 10 characters. */
sc_init_one(&main_list, NANO_JUSTIFY_KEY, N_("Justify"), sc_init_one(&main_list, NANO_JUSTIFY_KEY, N_("Justify"),
IFHELP(nano_justify_msg, NANO_NO_KEY), NANO_JUSTIFY_FKEY, IFHELP(nano_justify_msg, TRUE), NANO_NO_KEY, NANO_JUSTIFY_FKEY,
NANO_NO_KEY, NOVIEW, NANO_NO_KEY, NOVIEW,
#ifndef DISABLE_JUSTIFY #ifndef DISABLE_JUSTIFY
do_justify_void do_justify_void
...@@ -484,8 +485,8 @@ void shortcut_init(bool unjustify) ...@@ -484,8 +485,8 @@ void shortcut_init(bool unjustify)
/* TRANSLATORS: Try to keep this at most 10 characters. */ /* TRANSLATORS: Try to keep this at most 10 characters. */
sc_init_one(&main_list, NANO_INSERTFILE_KEY, N_("Read File"), sc_init_one(&main_list, NANO_INSERTFILE_KEY, N_("Read File"),
IFHELP(nano_insert_msg, NANO_NO_KEY), NANO_INSERTFILE_FKEY, IFHELP(nano_insert_msg, FALSE), NANO_NO_KEY,
NANO_NO_KEY, NANO_INSERTFILE_FKEY, NANO_NO_KEY,
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
VIEW VIEW
#else #else
...@@ -494,216 +495,198 @@ void shortcut_init(bool unjustify) ...@@ -494,216 +495,198 @@ void shortcut_init(bool unjustify)
, !ISSET(RESTRICTED) ? do_insertfile_void : nano_disabled_msg); , !ISSET(RESTRICTED) ? do_insertfile_void : nano_disabled_msg);
sc_init_one(&main_list, NANO_WHEREIS_KEY, whereis_msg, sc_init_one(&main_list, NANO_WHEREIS_KEY, whereis_msg,
IFHELP(nano_whereis_msg, NANO_NO_KEY), NANO_WHEREIS_FKEY, IFHELP(nano_whereis_msg, FALSE), NANO_NO_KEY, NANO_WHEREIS_FKEY,
NANO_NO_KEY, VIEW, do_search); NANO_NO_KEY, VIEW, do_search);
sc_init_one(&main_list, NANO_PREVPAGE_KEY, prev_page_msg, sc_init_one(&main_list, NANO_PREVPAGE_KEY, prev_page_msg,
IFHELP(nano_prevpage_msg, NANO_NO_KEY), NANO_PREVPAGE_FKEY, IFHELP(nano_prevpage_msg, FALSE), NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_page_up); NANO_PREVPAGE_FKEY, NANO_NO_KEY, VIEW, do_page_up);
sc_init_one(&main_list, NANO_NEXTPAGE_KEY, next_page_msg, sc_init_one(&main_list, NANO_NEXTPAGE_KEY, next_page_msg,
IFHELP(nano_nextpage_msg, NANO_NO_KEY), NANO_NEXTPAGE_FKEY, IFHELP(nano_nextpage_msg, TRUE), NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_page_down); NANO_NEXTPAGE_FKEY, NANO_NO_KEY, VIEW, do_page_down);
/* TRANSLATORS: Try to keep this at most 10 characters. */ /* TRANSLATORS: Try to keep this at most 10 characters. */
sc_init_one(&main_list, NANO_CUT_KEY, N_("Cut Text"), sc_init_one(&main_list, NANO_CUT_KEY, N_("Cut Text"),
IFHELP(nano_cut_msg, NANO_NO_KEY), NANO_CUT_FKEY, NANO_NO_KEY, IFHELP(nano_cut_msg, FALSE), NANO_NO_KEY, NANO_CUT_FKEY,
NOVIEW, do_cut_text); NANO_NO_KEY, NOVIEW, do_cut_text);
if (unjustify) if (unjustify)
/* TRANSLATORS: Try to keep this at most 10 characters. */ /* TRANSLATORS: Try to keep this at most 10 characters. */
sc_init_one(&main_list, NANO_UNJUSTIFY_KEY, N_("UnJustify"), sc_init_one(&main_list, NANO_UNJUSTIFY_KEY, N_("UnJustify"),
IFHELP(NULL, NANO_NO_KEY), NANO_UNJUSTIFY_FKEY, IFHELP(NULL, FALSE), NANO_NO_KEY, NANO_UNJUSTIFY_FKEY,
NANO_NO_KEY, NOVIEW, NULL); NANO_NO_KEY, NOVIEW, NULL);
else else
/* TRANSLATORS: Try to keep this at most 10 characters. */ /* TRANSLATORS: Try to keep this at most 10 characters. */
sc_init_one(&main_list, NANO_UNCUT_KEY, N_("UnCut Txt"), sc_init_one(&main_list, NANO_UNCUT_KEY, N_("UnCut Txt"),
IFHELP(nano_uncut_msg, NANO_NO_KEY), NANO_UNCUT_FKEY, IFHELP(nano_uncut_msg, FALSE), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, do_uncut_text); NANO_UNCUT_FKEY, NANO_NO_KEY, NOVIEW, do_uncut_text);
/* TRANSLATORS: Try to keep this at most 10 characters. */ /* TRANSLATORS: Try to keep this at most 10 characters. */
sc_init_one(&main_list, NANO_CURSORPOS_KEY, N_("Cur Pos"), sc_init_one(&main_list, NANO_CURSORPOS_KEY, N_("Cur Pos"),
IFHELP(nano_cursorpos_msg, NANO_NO_KEY), NANO_CURSORPOS_FKEY, IFHELP(nano_cursorpos_msg, FALSE), NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_cursorpos_void); NANO_CURSORPOS_FKEY, NANO_NO_KEY, VIEW, do_cursorpos_void);
/* If we're using restricted mode, spell checking is disabled /* If we're using restricted mode, spell checking is disabled
* because it allows reading from or writing to files not specified * because it allows reading from or writing to files not specified
* on the command line. */ * on the command line. */
/* TRANSLATORS: Try to keep this at most 10 characters. */ /* TRANSLATORS: Try to keep this at most 10 characters. */
sc_init_one(&main_list, NANO_SPELL_KEY, N_("To Spell"), sc_init_one(&main_list, NANO_SPELL_KEY, N_("To Spell"),
IFHELP(nano_spell_msg, NANO_NO_KEY), NANO_SPELL_FKEY, IFHELP(nano_spell_msg, TRUE), NANO_NO_KEY, NANO_SPELL_FKEY,
NANO_NO_KEY, NOVIEW, NANO_NO_KEY, NOVIEW,
#ifndef DISABLE_SPELLER #ifndef DISABLE_SPELLER
!ISSET(RESTRICTED) ? do_spell : !ISSET(RESTRICTED) ? do_spell :
#endif #endif
nano_disabled_msg); nano_disabled_msg);
sc_init_one(&main_list, NANO_GOTOLINE_KEY, go_to_line_msg, #ifndef NANO_TINY
IFHELP(nano_gotoline_msg, NANO_GOTOLINE_ALTKEY), sc_init_one(&main_list, NANO_NO_KEY, whereis_next_msg,
NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, IFHELP(nano_whereis_next_msg, FALSE), NANO_WHEREIS_NEXT_KEY,
do_gotolinecolumn_void); NANO_WHEREIS_NEXT_FKEY, NANO_NO_KEY, VIEW, do_research);
#endif
sc_init_one(&main_list, NANO_REPLACE_KEY, replace_msg, sc_init_one(&main_list, NANO_REPLACE_KEY, replace_msg,
IFHELP(nano_replace_msg, NANO_ALT_REPLACE_KEY), IFHELP(nano_replace_msg, FALSE), NANO_ALT_REPLACE_KEY,
NANO_REPLACE_FKEY, NANO_NO_KEY, NOVIEW, do_replace); NANO_REPLACE_FKEY, NANO_NO_KEY, NOVIEW, do_replace);
#ifndef NANO_TINY #ifndef NANO_TINY
/* TRANSLATORS: Try to keep this at most 16 characters. */ /* TRANSLATORS: Try to keep this at most 16 characters. */
sc_init_one(&main_list, NANO_MARK_KEY, N_("Mark Text"), sc_init_one(&main_list, NANO_MARK_KEY, N_("Mark Text"),
IFHELP(nano_mark_msg, NANO_MARK_ALTKEY), NANO_MARK_FKEY, IFHELP(nano_mark_msg, FALSE), NANO_MARK_ALTKEY, NANO_MARK_FKEY,
NANO_NO_KEY, VIEW, do_mark); NANO_NO_KEY, VIEW, do_mark);
sc_init_one(&main_list, NANO_NO_KEY, whereis_next_msg,
IFHELP(nano_whereis_next_msg, NANO_WHEREIS_NEXT_KEY),
NANO_WHEREIS_NEXT_FKEY, NANO_NO_KEY, VIEW, do_research);
#endif #endif
#ifndef DISABLE_HELP #ifndef NANO_TINY
/* This entry is blank, in order to make the help text easier to sc_init_one(&main_list, NANO_NO_KEY, cut_till_end_msg,
* read. */ IFHELP(nano_cut_till_end_msg, TRUE), NANO_CUTTILLEND_ALTKEY,
sc_init_one(&main_list, NANO_NO_KEY, NULL, NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end);
IFHELP(NULL, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW,
NULL);
#endif #endif
sc_init_one(&main_list, NANO_PREVLINE_KEY, N_("Prev Line"),
IFHELP(nano_prevline_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_up);
sc_init_one(&main_list, NANO_NEXTLINE_KEY, N_("Next Line"),
IFHELP(nano_nextline_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_down);
sc_init_one(&main_list, NANO_FORWARD_KEY, N_("Forward"), sc_init_one(&main_list, NANO_FORWARD_KEY, N_("Forward"),
IFHELP(nano_forward_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_forward_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, do_right); NANO_NO_KEY, VIEW, do_right);
sc_init_one(&main_list, NANO_BACK_KEY, N_("Back"), sc_init_one(&main_list, NANO_BACK_KEY, N_("Back"),
IFHELP(nano_back_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_back_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, do_left); NANO_NO_KEY, VIEW, do_left);
sc_init_one(&main_list, NANO_HOME_KEY, N_("Home"),
IFHELP(nano_home_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY,
VIEW, do_home);
sc_init_one(&main_list, NANO_END_KEY, N_("End"),
IFHELP(nano_end_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY,
VIEW, do_end);
sc_init_one(&main_list, NANO_DELETE_KEY, N_("Delete"),
IFHELP(nano_delete_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY,
NOVIEW, do_delete);
sc_init_one(&main_list, NANO_BACKSPACE_KEY, N_("Backspace"),
IFHELP(nano_backspace_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, do_backspace);
sc_init_one(&main_list, NANO_TAB_KEY, N_("Tab"),
IFHELP(nano_tab_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY,
NOVIEW, do_tab);
sc_init_one(&main_list, NANO_ENTER_KEY, N_("Enter"),
IFHELP(nano_enter_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY,
NOVIEW, do_enter);
sc_init_one(&main_list, NANO_REFRESH_KEY, refresh_msg,
IFHELP(nano_refresh_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY,
VIEW, total_refresh);
#ifndef DISABLE_HELP
/* This entry is blank, in order to make the help text easier to
* read. */
sc_init_one(&main_list, NANO_NO_KEY, NULL,
IFHELP(NULL, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW,
NULL);
#endif
#ifndef NANO_TINY #ifndef NANO_TINY
sc_init_one(&main_list, NANO_NEXTWORD_KEY, N_("Next Word"), sc_init_one(&main_list, NANO_NEXTWORD_KEY, N_("Next Word"),
IFHELP(nano_nextword_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_nextword_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_next_word_void); NANO_NO_KEY, VIEW, do_next_word_void);
sc_init_one(&main_list, NANO_NO_KEY, N_("Prev Word"), sc_init_one(&main_list, NANO_NO_KEY, N_("Prev Word"),
IFHELP(nano_prevword_msg, NANO_PREVWORD_KEY), NANO_NO_KEY, IFHELP(nano_prevword_msg, FALSE), NANO_PREVWORD_KEY,
NANO_NO_KEY, VIEW, do_prev_word_void); NANO_NO_KEY, NANO_NO_KEY, VIEW, do_prev_word_void);
#endif
sc_init_one(&main_list, NANO_NO_KEY, N_("Word Count"), sc_init_one(&main_list, NANO_PREVLINE_KEY, N_("Prev Line"),
IFHELP(nano_wordcount_msg, NANO_WORDCOUNT_KEY), NANO_NO_KEY, IFHELP(nano_prevline_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_wordlinechar_count); NANO_NO_KEY, VIEW, do_up);
sc_init_one(&main_list, NANO_NO_KEY, N_("Scroll Up"), sc_init_one(&main_list, NANO_NEXTLINE_KEY, N_("Next Line"),
IFHELP(nano_scrollup_msg, NANO_SCROLLUP_KEY), NANO_NO_KEY, IFHELP(nano_nextline_msg, TRUE), NANO_NO_KEY, NANO_NO_KEY,
NANO_SCROLLUP_ALTKEY, VIEW, do_scroll_up); NANO_NO_KEY, VIEW, do_down);
sc_init_one(&main_list, NANO_NO_KEY, N_("Scroll Down"), sc_init_one(&main_list, NANO_HOME_KEY, N_("Home"),
IFHELP(nano_scrolldown_msg, NANO_SCROLLDOWN_KEY), NANO_NO_KEY, IFHELP(nano_home_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
NANO_SCROLLDOWN_ALTKEY, VIEW, do_scroll_down); NANO_NO_KEY, VIEW, do_home);
#endif
sc_init_one(&main_list, NANO_END_KEY, N_("End"),
IFHELP(nano_end_msg, FALSE), NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_end);
#ifndef DISABLE_JUSTIFY #ifndef DISABLE_JUSTIFY
sc_init_one(&main_list, NANO_NO_KEY, beg_of_par_msg, sc_init_one(&main_list, NANO_NO_KEY, beg_of_par_msg,
IFHELP(nano_parabegin_msg, NANO_PARABEGIN_ALTKEY1), NANO_NO_KEY, IFHELP(nano_parabegin_msg, FALSE), NANO_PARABEGIN_ALTKEY,
NANO_PARABEGIN_ALTKEY2, VIEW, do_para_begin_void); NANO_NO_KEY, NANO_PARABEGIN_ALTKEY2, VIEW, do_para_begin_void);
sc_init_one(&main_list, NANO_NO_KEY, end_of_par_msg, sc_init_one(&main_list, NANO_NO_KEY, end_of_par_msg,
IFHELP(nano_paraend_msg, NANO_PARAEND_ALTKEY1), NANO_NO_KEY, IFHELP(nano_paraend_msg, FALSE), NANO_PARAEND_ALTKEY,
NANO_PARAEND_ALTKEY2, VIEW, do_para_end_void); NANO_NO_KEY, NANO_PARAEND_ALTKEY2, VIEW, do_para_end_void);
#endif #endif
sc_init_one(&main_list, NANO_NO_KEY, first_line_msg, sc_init_one(&main_list, NANO_NO_KEY, first_line_msg,
IFHELP(nano_firstline_msg, NANO_FIRSTLINE_ALTKEY), NANO_NO_KEY, IFHELP(nano_firstline_msg, FALSE), NANO_FIRSTLINE_ALTKEY,
NANO_FIRSTLINE_ALTKEY2, VIEW, do_first_line); NANO_NO_KEY, NANO_FIRSTLINE_ALTKEY2, VIEW, do_first_line);
sc_init_one(&main_list, NANO_NO_KEY, last_line_msg, sc_init_one(&main_list, NANO_NO_KEY, last_line_msg,
IFHELP(nano_lastline_msg, NANO_LASTLINE_ALTKEY), NANO_NO_KEY, IFHELP(nano_lastline_msg, TRUE), NANO_LASTLINE_ALTKEY,
NANO_LASTLINE_ALTKEY2, VIEW, do_last_line); NANO_NO_KEY, NANO_LASTLINE_ALTKEY2, VIEW, do_last_line);
#ifndef NANO_TINY
sc_init_one(&main_list, NANO_NO_KEY, N_("Find Other Bracket"),
IFHELP(nano_bracket_msg, FALSE), NANO_BRACKET_KEY, NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_find_bracket);
#endif
sc_init_one(&main_list, NANO_GOTOLINE_KEY, go_to_line_msg,
IFHELP(nano_gotoline_msg, FALSE), NANO_GOTOLINE_ALTKEY,
NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW,
do_gotolinecolumn_void);
#ifndef NANO_TINY
sc_init_one(&main_list, NANO_NO_KEY, N_("Scroll Up"),
IFHELP(nano_scrollup_msg, FALSE), NANO_SCROLLUP_KEY,
NANO_NO_KEY, NANO_SCROLLUP_ALTKEY, VIEW, do_scroll_up);
sc_init_one(&main_list, NANO_NO_KEY, N_("Scroll Down"),
IFHELP(nano_scrolldown_msg, TRUE), NANO_SCROLLDOWN_KEY,
NANO_NO_KEY, NANO_SCROLLDOWN_ALTKEY, VIEW, do_scroll_down);
#endif
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
sc_init_one(&main_list, NANO_NO_KEY, N_("Previous File"), sc_init_one(&main_list, NANO_NO_KEY, N_("Previous File"),
IFHELP(nano_prevfile_msg, NANO_PREVFILE_KEY), NANO_NO_KEY, IFHELP(nano_prevfile_msg, FALSE), NANO_PREVFILE_KEY,
NANO_PREVFILE_ALTKEY, VIEW, switch_to_prev_buffer_void); NANO_NO_KEY, NANO_PREVFILE_ALTKEY, VIEW,
switch_to_prev_buffer_void);
sc_init_one(&main_list, NANO_NO_KEY, N_("Next File"), sc_init_one(&main_list, NANO_NO_KEY, N_("Next File"),
IFHELP(nano_nextfile_msg, NANO_NEXTFILE_KEY), NANO_NO_KEY, IFHELP(nano_nextfile_msg, TRUE), NANO_NEXTFILE_KEY, NANO_NO_KEY,
NANO_NEXTFILE_ALTKEY, VIEW, switch_to_next_buffer_void); NANO_NEXTFILE_ALTKEY, VIEW, switch_to_next_buffer_void);
#endif #endif
sc_init_one(&main_list, NANO_NO_KEY, N_("Verbatim Input"), sc_init_one(&main_list, NANO_NO_KEY, N_("Verbatim Input"),
IFHELP(nano_verbatim_msg, NANO_VERBATIM_KEY), NANO_NO_KEY, IFHELP(nano_verbatim_msg, FALSE), NANO_VERBATIM_KEY,
NANO_NO_KEY, NOVIEW, do_verbatim_input); NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_verbatim_input);
#ifndef NANO_TINY sc_init_one(&main_list, NANO_TAB_KEY, N_("Tab"),
sc_init_one(&main_list, NANO_NO_KEY, cut_till_end_msg, IFHELP(nano_tab_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
IFHELP(nano_cut_till_end_msg, NANO_CUTTILLEND_ALTKEY), NANO_NO_KEY, NOVIEW, do_tab);
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end);
#endif sc_init_one(&main_list, NANO_ENTER_KEY, N_("Enter"),
IFHELP(nano_enter_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, do_enter);
sc_init_one(&main_list, NANO_DELETE_KEY, N_("Delete"),
IFHELP(nano_delete_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, do_delete);
sc_init_one(&main_list, NANO_BACKSPACE_KEY, N_("Backspace"),
IFHELP(nano_backspace_msg, TRUE), NANO_NO_KEY, NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, do_backspace);
#ifndef DISABLE_JUSTIFY #ifndef DISABLE_JUSTIFY
sc_init_one(&main_list, NANO_NO_KEY, fulljstify_msg, sc_init_one(&main_list, NANO_NO_KEY, fulljstify_msg,
IFHELP(nano_fulljustify_msg, NANO_FULLJUSTIFY_ALTKEY), IFHELP(nano_fulljustify_msg, FALSE), NANO_FULLJUSTIFY_ALTKEY,
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify); NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify);
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
sc_init_one(&main_list, NANO_NO_KEY, N_("Find Other Bracket"), sc_init_one(&main_list, NANO_NO_KEY, N_("Word Count"),
IFHELP(nano_bracket_msg, NANO_BRACKET_KEY), NANO_NO_KEY, IFHELP(nano_wordcount_msg, FALSE), NANO_WORDCOUNT_KEY,
NANO_NO_KEY, VIEW, do_find_bracket); NANO_NO_KEY, NANO_NO_KEY, VIEW, do_wordlinechar_count);
#ifndef DISABLE_HELP
/* This entry is blank, in order to make the help text easier to
* read. It's at the end of the list in order to separate the
* shortcut keys from the toggles. */
sc_init_one(&main_list, NANO_NO_KEY, NULL,
IFHELP(NULL, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW,
NULL);
#endif
#endif #endif
sc_init_one(&main_list, NANO_REFRESH_KEY, refresh_msg,
IFHELP(nano_refresh_msg, TRUE), NANO_NO_KEY, NANO_NO_KEY,
NANO_NO_KEY, VIEW, total_refresh);
free_shortcutage(&whereis_list); free_shortcutage(&whereis_list);
sc_init_one(&whereis_list, NANO_HELP_KEY, get_help_msg, sc_init_one(&whereis_list, NANO_HELP_KEY, get_help_msg,
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY,
VIEW, NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
do_help_void do_help_void
#else #else
...@@ -712,73 +695,73 @@ void shortcut_init(bool unjustify) ...@@ -712,73 +695,73 @@ void shortcut_init(bool unjustify)
); );
sc_init_one(&whereis_list, NANO_CANCEL_KEY, cancel_msg, sc_init_one(&whereis_list, NANO_CANCEL_KEY, cancel_msg,
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&whereis_list, NANO_FIRSTLINE_KEY, first_line_msg, sc_init_one(&whereis_list, NANO_FIRSTLINE_KEY, first_line_msg,
IFHELP(nano_firstline_msg, NANO_FIRSTLINE_ALTKEY), IFHELP(nano_firstline_msg, FALSE), NANO_FIRSTLINE_ALTKEY,
NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_ALTKEY2, VIEW, NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_ALTKEY2, VIEW,
do_first_line); do_first_line);
sc_init_one(&whereis_list, NANO_LASTLINE_KEY, last_line_msg, sc_init_one(&whereis_list, NANO_LASTLINE_KEY, last_line_msg,
IFHELP(nano_lastline_msg, NANO_LASTLINE_ALTKEY), IFHELP(nano_lastline_msg, FALSE), NANO_LASTLINE_ALTKEY,
NANO_LASTLINE_FKEY, NANO_LASTLINE_ALTKEY2, VIEW, do_last_line); NANO_LASTLINE_FKEY, NANO_LASTLINE_ALTKEY2, VIEW, do_last_line);
sc_init_one(&whereis_list, NANO_TOOTHERSEARCH_KEY, replace_msg, sc_init_one(&whereis_list, NANO_TOOTHERSEARCH_KEY, replace_msg,
IFHELP(nano_replace_msg, NANO_NO_KEY), NANO_REPLACE_FKEY, IFHELP(nano_replace_msg, FALSE), NANO_NO_KEY, NANO_REPLACE_FKEY,
NANO_NO_KEY, VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&whereis_list, NANO_TOGOTOLINE_KEY, go_to_line_msg, sc_init_one(&whereis_list, NANO_TOGOTOLINE_KEY, go_to_line_msg,
IFHELP(nano_gotoline_msg, NANO_NO_KEY), NANO_GOTOLINE_FKEY, IFHELP(nano_gotoline_msg, FALSE), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, NULL);
#ifndef DISABLE_JUSTIFY #ifndef DISABLE_JUSTIFY
sc_init_one(&whereis_list, NANO_PARABEGIN_KEY, beg_of_par_msg, sc_init_one(&whereis_list, NANO_PARABEGIN_KEY, beg_of_par_msg,
IFHELP(nano_parabegin_msg, NANO_PARABEGIN_ALTKEY1), NANO_NO_KEY, IFHELP(nano_parabegin_msg, FALSE), NANO_PARABEGIN_ALTKEY,
NANO_PARABEGIN_ALTKEY2, VIEW, do_para_begin_void); NANO_NO_KEY, NANO_PARABEGIN_ALTKEY2, VIEW, do_para_begin_void);
sc_init_one(&whereis_list, NANO_PARAEND_KEY, end_of_par_msg, sc_init_one(&whereis_list, NANO_PARAEND_KEY, end_of_par_msg,
IFHELP(nano_paraend_msg, NANO_PARAEND_ALTKEY1), NANO_NO_KEY, IFHELP(nano_paraend_msg, FALSE), NANO_PARAEND_ALTKEY,
NANO_PARAEND_ALTKEY2, VIEW, do_para_end_void); NANO_NO_KEY, NANO_PARAEND_ALTKEY2, VIEW, do_para_end_void);
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
sc_init_one(&whereis_list, NANO_NO_KEY, case_sens_msg, sc_init_one(&whereis_list, NANO_NO_KEY, case_sens_msg,
IFHELP(nano_case_msg, TOGGLE_CASE_KEY), NANO_NO_KEY, IFHELP(nano_case_msg, FALSE), TOGGLE_CASE_KEY, NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&whereis_list, NANO_NO_KEY, backwards_msg, sc_init_one(&whereis_list, NANO_NO_KEY, backwards_msg,
IFHELP(nano_reverse_msg, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY, IFHELP(nano_reverse_msg, FALSE), TOGGLE_BACKWARDS_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
#endif #endif
#ifdef HAVE_REGEX_H #ifdef HAVE_REGEX_H
sc_init_one(&whereis_list, NANO_NO_KEY, regexp_msg, sc_init_one(&whereis_list, NANO_NO_KEY, regexp_msg,
IFHELP(nano_regexp_msg, NANO_REGEXP_KEY), NANO_NO_KEY, IFHELP(nano_regexp_msg, FALSE), NANO_REGEXP_KEY, NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
sc_init_one(&whereis_list, NANO_PREVLINE_KEY, history_msg, sc_init_one(&whereis_list, NANO_PREVLINE_KEY, history_msg,
IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_history_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&whereis_list, NANO_CUTTILLEND_KEY, cut_till_end_msg, sc_init_one(&whereis_list, NANO_CUTTILLEND_KEY, cut_till_end_msg,
IFHELP(nano_cut_till_end_msg, NANO_CUTTILLEND_ALTKEY), IFHELP(nano_cut_till_end_msg, FALSE), NANO_CUTTILLEND_ALTKEY,
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end); NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end);
#endif #endif
#ifndef DISABLE_JUSTIFY #ifndef DISABLE_JUSTIFY
sc_init_one(&whereis_list, NANO_FULLJUSTIFY_KEY, fulljstify_msg, sc_init_one(&whereis_list, NANO_FULLJUSTIFY_KEY, fulljstify_msg,
IFHELP(nano_fulljustify_msg, NANO_FULLJUSTIFY_ALTKEY), IFHELP(nano_fulljustify_msg, FALSE), NANO_FULLJUSTIFY_ALTKEY,
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify); NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify);
#endif #endif
free_shortcutage(&replace_list); free_shortcutage(&replace_list);
sc_init_one(&replace_list, NANO_HELP_KEY, get_help_msg, sc_init_one(&replace_list, NANO_HELP_KEY, get_help_msg,
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY,
VIEW, NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
do_help_void do_help_void
#else #else
...@@ -787,54 +770,54 @@ void shortcut_init(bool unjustify) ...@@ -787,54 +770,54 @@ void shortcut_init(bool unjustify)
); );
sc_init_one(&replace_list, NANO_CANCEL_KEY, cancel_msg, sc_init_one(&replace_list, NANO_CANCEL_KEY, cancel_msg,
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&replace_list, NANO_FIRSTLINE_KEY, first_line_msg, sc_init_one(&replace_list, NANO_FIRSTLINE_KEY, first_line_msg,
IFHELP(nano_firstline_msg, NANO_FIRSTLINE_ALTKEY), IFHELP(nano_firstline_msg, FALSE), NANO_FIRSTLINE_ALTKEY,
NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_ALTKEY2, VIEW, NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_ALTKEY2, VIEW,
do_first_line); do_first_line);
sc_init_one(&replace_list, NANO_LASTLINE_KEY, last_line_msg, sc_init_one(&replace_list, NANO_LASTLINE_KEY, last_line_msg,
IFHELP(nano_lastline_msg, NANO_LASTLINE_ALTKEY), IFHELP(nano_lastline_msg, FALSE), NANO_LASTLINE_ALTKEY,
NANO_LASTLINE_FKEY, NANO_LASTLINE_ALTKEY2, VIEW, do_last_line); NANO_LASTLINE_FKEY, NANO_LASTLINE_ALTKEY2, VIEW, do_last_line);
/* TRANSLATORS: Try to keep this at most 12 characters. */ /* TRANSLATORS: Try to keep this at most 12 characters. */
sc_init_one(&replace_list, NANO_TOOTHERSEARCH_KEY, N_("No Replace"), sc_init_one(&replace_list, NANO_TOOTHERSEARCH_KEY, N_("No Replace"),
IFHELP(nano_whereis_msg, NANO_NO_KEY), NANO_REPLACE_FKEY, IFHELP(nano_whereis_msg, FALSE), NANO_NO_KEY),
NANO_NO_KEY, VIEW, NULL); NANO_REPLACE_FKEY, NANO_NO_KEY, VIEW, NULL);
sc_init_one(&replace_list, NANO_TOGOTOLINE_KEY, go_to_line_msg, sc_init_one(&replace_list, NANO_TOGOTOLINE_KEY, go_to_line_msg,
IFHELP(nano_gotoline_msg, NANO_NO_KEY), NANO_GOTOLINE_FKEY, IFHELP(nano_gotoline_msg, FALSE), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, NULL);
#ifndef NANO_TINY #ifndef NANO_TINY
sc_init_one(&replace_list, NANO_NO_KEY, case_sens_msg, sc_init_one(&replace_list, NANO_NO_KEY, case_sens_msg,
IFHELP(nano_case_msg, TOGGLE_CASE_KEY), NANO_NO_KEY, IFHELP(nano_case_msg, FALSE), TOGGLE_CASE_KEY, NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&replace_list, NANO_NO_KEY, backwards_msg, sc_init_one(&replace_list, NANO_NO_KEY, backwards_msg,
IFHELP(nano_reverse_msg, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY, IFHELP(nano_reverse_msg, FALSE), TOGGLE_BACKWARDS_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
#endif #endif
#ifdef HAVE_REGEX_H #ifdef HAVE_REGEX_H
sc_init_one(&replace_list, NANO_NO_KEY, regexp_msg, sc_init_one(&replace_list, NANO_NO_KEY, regexp_msg,
IFHELP(nano_regexp_msg, NANO_REGEXP_KEY), NANO_NO_KEY, IFHELP(nano_regexp_msg, FALSE), NANO_REGEXP_KEY, NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
sc_init_one(&replace_list, NANO_PREVLINE_KEY, history_msg, sc_init_one(&replace_list, NANO_PREVLINE_KEY, history_msg,
IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_history_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
#endif #endif
free_shortcutage(&replace_list_2); free_shortcutage(&replace_list_2);
sc_init_one(&replace_list_2, NANO_HELP_KEY, get_help_msg, sc_init_one(&replace_list_2, NANO_HELP_KEY, get_help_msg,
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY,
VIEW, NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
do_help_void do_help_void
#else #else
...@@ -843,29 +826,29 @@ void shortcut_init(bool unjustify) ...@@ -843,29 +826,29 @@ void shortcut_init(bool unjustify)
); );
sc_init_one(&replace_list_2, NANO_CANCEL_KEY, cancel_msg, sc_init_one(&replace_list_2, NANO_CANCEL_KEY, cancel_msg,
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&replace_list_2, NANO_FIRSTLINE_KEY, first_line_msg, sc_init_one(&replace_list_2, NANO_FIRSTLINE_KEY, first_line_msg,
IFHELP(nano_firstline_msg, NANO_FIRSTLINE_ALTKEY), IFHELP(nano_firstline_msg, FALSE), NANO_FIRSTLINE_ALTKEY,
NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_ALTKEY2, VIEW, NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_ALTKEY2, VIEW,
do_first_line); do_first_line);
sc_init_one(&replace_list_2, NANO_LASTLINE_KEY, last_line_msg, sc_init_one(&replace_list_2, NANO_LASTLINE_KEY, last_line_msg,
IFHELP(nano_lastline_msg, NANO_LASTLINE_ALTKEY), IFHELP(nano_lastline_msg, FALSE), NANO_LASTLINE_ALTKEY,
NANO_LASTLINE_FKEY, NANO_LASTLINE_ALTKEY2, VIEW, do_last_line); NANO_LASTLINE_FKEY, NANO_LASTLINE_ALTKEY2, VIEW, do_last_line);
#ifndef NANO_TINY #ifndef NANO_TINY
sc_init_one(&replace_list_2, NANO_PREVLINE_KEY, history_msg, sc_init_one(&replace_list_2, NANO_PREVLINE_KEY, history_msg,
IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_history_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
#endif #endif
free_shortcutage(&gotoline_list); free_shortcutage(&gotoline_list);
sc_init_one(&gotoline_list, NANO_HELP_KEY, get_help_msg, sc_init_one(&gotoline_list, NANO_HELP_KEY, get_help_msg,
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY,
VIEW, NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
do_help_void do_help_void
#else #else
...@@ -874,27 +857,27 @@ void shortcut_init(bool unjustify) ...@@ -874,27 +857,27 @@ void shortcut_init(bool unjustify)
); );
sc_init_one(&gotoline_list, NANO_CANCEL_KEY, cancel_msg, sc_init_one(&gotoline_list, NANO_CANCEL_KEY, cancel_msg,
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&gotoline_list, NANO_FIRSTLINE_KEY, first_line_msg, sc_init_one(&gotoline_list, NANO_FIRSTLINE_KEY, first_line_msg,
IFHELP(nano_firstline_msg, NANO_FIRSTLINE_ALTKEY), IFHELP(nano_firstline_msg, FALSE), NANO_FIRSTLINE_ALTKEY,
NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_ALTKEY2, VIEW, NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_ALTKEY2, VIEW,
do_first_line); do_first_line);
sc_init_one(&gotoline_list, NANO_LASTLINE_KEY, last_line_msg, sc_init_one(&gotoline_list, NANO_LASTLINE_KEY, last_line_msg,
IFHELP(nano_lastline_msg, NANO_LASTLINE_ALTKEY), IFHELP(nano_lastline_msg, FALSE), NANO_LASTLINE_ALTKEY,
NANO_LASTLINE_FKEY, NANO_LASTLINE_ALTKEY2, VIEW, do_last_line); NANO_LASTLINE_FKEY, NANO_LASTLINE_ALTKEY2, VIEW, do_last_line);
sc_init_one(&gotoline_list, NANO_TOOTHERWHEREIS_KEY, sc_init_one(&gotoline_list, NANO_TOOTHERWHEREIS_KEY,
N_("Go To Text"), IFHELP(nano_whereis_msg, NANO_NO_KEY), N_("Go To Text"), IFHELP(nano_whereis_msg, FALSE), NANO_NO_KEY,
NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
free_shortcutage(&writefile_list); free_shortcutage(&writefile_list);
sc_init_one(&writefile_list, NANO_HELP_KEY, get_help_msg, sc_init_one(&writefile_list, NANO_HELP_KEY, get_help_msg,
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY,
VIEW, NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
do_help_void do_help_void
#else #else
...@@ -903,8 +886,8 @@ void shortcut_init(bool unjustify) ...@@ -903,8 +886,8 @@ void shortcut_init(bool unjustify)
); );
sc_init_one(&writefile_list, NANO_CANCEL_KEY, cancel_msg, sc_init_one(&writefile_list, NANO_CANCEL_KEY, cancel_msg,
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
#ifndef DISABLE_BROWSER #ifndef DISABLE_BROWSER
/* If we're using restricted mode, the file browser is disabled. /* If we're using restricted mode, the file browser is disabled.
...@@ -912,8 +895,8 @@ void shortcut_init(bool unjustify) ...@@ -912,8 +895,8 @@ void shortcut_init(bool unjustify)
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
sc_init_one(&writefile_list, NANO_TOFILES_KEY, to_files_msg, sc_init_one(&writefile_list, NANO_TOFILES_KEY, to_files_msg,
IFHELP(nano_tofiles_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_tofiles_msg, FALSE), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, NULL); NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
...@@ -927,41 +910,41 @@ void shortcut_init(bool unjustify) ...@@ -927,41 +910,41 @@ void shortcut_init(bool unjustify)
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
/* TRANSLATORS: Try to keep this at most 16 characters. */ /* TRANSLATORS: Try to keep this at most 16 characters. */
sc_init_one(&writefile_list, NANO_NO_KEY, N_("DOS Format"), sc_init_one(&writefile_list, NANO_NO_KEY, N_("DOS Format"),
IFHELP(nano_dos_msg, TOGGLE_DOS_KEY), NANO_NO_KEY, IFHELP(nano_dos_msg, FALSE), TOGGLE_DOS_KEY,
NANO_NO_KEY, NOVIEW, NULL); NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
/* TRANSLATORS: Try to keep this at most 16 characters. */ /* TRANSLATORS: Try to keep this at most 16 characters. */
sc_init_one(&writefile_list, NANO_NO_KEY, N_("Mac Format"), sc_init_one(&writefile_list, NANO_NO_KEY, N_("Mac Format"),
IFHELP(nano_mac_msg, TOGGLE_MAC_KEY), NANO_NO_KEY, IFHELP(nano_mac_msg, FALSE), TOGGLE_MAC_KEY,
NANO_NO_KEY, NOVIEW, NULL); NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
#endif #endif
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
/* TRANSLATORS: Try to keep this at most 16 characters. */ /* TRANSLATORS: Try to keep this at most 16 characters. */
sc_init_one(&writefile_list, NANO_NO_KEY, N_("Append"), sc_init_one(&writefile_list, NANO_NO_KEY, N_("Append"),
IFHELP(nano_append_msg, NANO_APPEND_KEY), NANO_NO_KEY, IFHELP(nano_append_msg, FALSE), NANO_APPEND_KEY,
NANO_NO_KEY, NOVIEW, NULL); NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
/* TRANSLATORS: Try to keep this at most 16 characters. */ /* TRANSLATORS: Try to keep this at most 16 characters. */
sc_init_one(&writefile_list, NANO_NO_KEY, N_("Prepend"), sc_init_one(&writefile_list, NANO_NO_KEY, N_("Prepend"),
IFHELP(nano_prepend_msg, NANO_PREPEND_KEY), NANO_NO_KEY, IFHELP(nano_prepend_msg, FALSE), NANO_PREPEND_KEY,
NANO_NO_KEY, NOVIEW, NULL); NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
#ifndef NANO_TINY #ifndef NANO_TINY
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
/* TRANSLATORS: Try to keep this at most 16 characters. */ /* TRANSLATORS: Try to keep this at most 16 characters. */
sc_init_one(&writefile_list, NANO_NO_KEY, N_("Backup File"), sc_init_one(&writefile_list, NANO_NO_KEY, N_("Backup File"),
IFHELP(nano_backup_msg, TOGGLE_BACKUP_KEY), NANO_NO_KEY, IFHELP(nano_backup_msg, FALSE), TOGGLE_BACKUP_KEY,
NANO_NO_KEY, NOVIEW, NULL); NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
#endif #endif
free_shortcutage(&insertfile_list); free_shortcutage(&insertfile_list);
sc_init_one(&insertfile_list, NANO_HELP_KEY, get_help_msg, sc_init_one(&insertfile_list, NANO_HELP_KEY, get_help_msg,
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY,
VIEW, NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
do_help_void do_help_void
#else #else
...@@ -970,16 +953,16 @@ void shortcut_init(bool unjustify) ...@@ -970,16 +953,16 @@ void shortcut_init(bool unjustify)
); );
sc_init_one(&insertfile_list, NANO_CANCEL_KEY, cancel_msg, sc_init_one(&insertfile_list, NANO_CANCEL_KEY, cancel_msg,
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
#ifndef DISABLE_BROWSER #ifndef DISABLE_BROWSER
/* If we're using restricted mode, the file browser is disabled. /* If we're using restricted mode, the file browser is disabled.
* It's useless since inserting files is disabled. */ * It's useless since inserting files is disabled. */
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
sc_init_one(&insertfile_list, NANO_TOFILES_KEY, to_files_msg, sc_init_one(&insertfile_list, NANO_TOFILES_KEY, to_files_msg,
IFHELP(nano_tofiles_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_tofiles_msg, FALSE), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, NULL); NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
...@@ -989,8 +972,8 @@ void shortcut_init(bool unjustify) ...@@ -989,8 +972,8 @@ void shortcut_init(bool unjustify)
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
sc_init_one(&insertfile_list, NANO_TOOTHERINSERT_KEY, sc_init_one(&insertfile_list, NANO_TOOTHERINSERT_KEY,
/* TRANSLATORS: Try to keep this at most 22 characters. */ /* TRANSLATORS: Try to keep this at most 22 characters. */
N_("Execute Command"), IFHELP(nano_execute_msg, N_("Execute Command"), IFHELP(nano_execute_msg, FALSE),
NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); NANO_NO_KEY, NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
/* If we're using restricted mode, the multibuffer toggle is /* If we're using restricted mode, the multibuffer toggle is
...@@ -998,8 +981,9 @@ void shortcut_init(bool unjustify) ...@@ -998,8 +981,9 @@ void shortcut_init(bool unjustify)
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
sc_init_one(&insertfile_list, NANO_NO_KEY, new_buffer_msg, sc_init_one(&insertfile_list, NANO_NO_KEY, new_buffer_msg,
IFHELP(nano_multibuffer_msg, TOGGLE_MULTIBUFFER_KEY), IFHELP(nano_multibuffer_msg, FALSE),
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); TOGGLE_MULTIBUFFER_KEY, NANO_NO_KEY, NANO_NO_KEY,
NOVIEW, NULL);
#endif #endif
#endif #endif
...@@ -1007,8 +991,8 @@ void shortcut_init(bool unjustify) ...@@ -1007,8 +991,8 @@ void shortcut_init(bool unjustify)
free_shortcutage(&extcmd_list); free_shortcutage(&extcmd_list);
sc_init_one(&extcmd_list, NANO_HELP_KEY, get_help_msg, sc_init_one(&extcmd_list, NANO_HELP_KEY, get_help_msg,
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY,
VIEW, NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
do_help_void do_help_void
#else #else
...@@ -1017,16 +1001,16 @@ void shortcut_init(bool unjustify) ...@@ -1017,16 +1001,16 @@ void shortcut_init(bool unjustify)
); );
sc_init_one(&extcmd_list, NANO_CANCEL_KEY, cancel_msg, sc_init_one(&extcmd_list, NANO_CANCEL_KEY, cancel_msg,
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&extcmd_list, NANO_TOOTHERINSERT_KEY, N_("Insert File"), sc_init_one(&extcmd_list, NANO_TOOTHERINSERT_KEY, N_("Insert File"),
IFHELP(nano_insert_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_insert_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
sc_init_one(&extcmd_list, NANO_NO_KEY, new_buffer_msg, sc_init_one(&extcmd_list, NANO_NO_KEY, new_buffer_msg,
IFHELP(nano_multibuffer_msg, TOGGLE_MULTIBUFFER_KEY), IFHELP(nano_multibuffer_msg, FALSE), TOGGLE_MULTIBUFFER_KEY,
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
#endif #endif
#endif #endif
...@@ -1035,27 +1019,27 @@ void shortcut_init(bool unjustify) ...@@ -1035,27 +1019,27 @@ void shortcut_init(bool unjustify)
free_shortcutage(&help_list); free_shortcutage(&help_list);
sc_init_one(&help_list, NANO_REFRESH_KEY, refresh_msg, sc_init_one(&help_list, NANO_REFRESH_KEY, refresh_msg,
IFHELP(nano_refresh_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_refresh_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&help_list, NANO_EXIT_KEY, exit_msg, sc_init_one(&help_list, NANO_EXIT_KEY, exit_msg,
IFHELP(nano_exit_msg, NANO_NO_KEY), NANO_EXIT_FKEY, NANO_NO_KEY, IFHELP(nano_exit_msg, FALSE), NANO_NO_KEY, NANO_EXIT_FKEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&help_list, NANO_PREVPAGE_KEY, prev_page_msg, sc_init_one(&help_list, NANO_PREVPAGE_KEY, prev_page_msg,
IFHELP(nano_prevpage_msg, NANO_NO_KEY), NANO_PREVPAGE_FKEY, IFHELP(nano_prevpage_msg, FALSE), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_PREVPAGE_FKEY, NANO_NO_KEY, VIEW, NULL);
sc_init_one(&help_list, NANO_NEXTPAGE_KEY, next_page_msg, sc_init_one(&help_list, NANO_NEXTPAGE_KEY, next_page_msg,
IFHELP(nano_nextpage_msg, NANO_NO_KEY), NANO_NEXTPAGE_FKEY, IFHELP(nano_nextpage_msg, FALSE), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_NEXTPAGE_FKEY, NANO_NO_KEY, VIEW, NULL);
sc_init_one(&help_list, NANO_PREVLINE_KEY, N_("Prev Line"), sc_init_one(&help_list, NANO_PREVLINE_KEY, N_("Prev Line"),
IFHELP(nano_prevline_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_prevline_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&help_list, NANO_NEXTLINE_KEY, N_("Next Line"), sc_init_one(&help_list, NANO_NEXTLINE_KEY, N_("Next Line"),
IFHELP(nano_nextline_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_nextline_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
#endif #endif
...@@ -1063,8 +1047,8 @@ void shortcut_init(bool unjustify) ...@@ -1063,8 +1047,8 @@ void shortcut_init(bool unjustify)
free_shortcutage(&spell_list); free_shortcutage(&spell_list);
sc_init_one(&spell_list, NANO_HELP_KEY, get_help_msg, sc_init_one(&spell_list, NANO_HELP_KEY, get_help_msg,
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY,
VIEW, NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
do_help_void do_help_void
#else #else
...@@ -1073,47 +1057,47 @@ void shortcut_init(bool unjustify) ...@@ -1073,47 +1057,47 @@ void shortcut_init(bool unjustify)
); );
sc_init_one(&spell_list, NANO_CANCEL_KEY, cancel_msg, sc_init_one(&spell_list, NANO_CANCEL_KEY, cancel_msg,
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
#endif #endif
#ifndef DISABLE_BROWSER #ifndef DISABLE_BROWSER
free_shortcutage(&browser_list); free_shortcutage(&browser_list);
sc_init_one(&browser_list, NANO_HELP_KEY, get_help_msg, sc_init_one(&browser_list, NANO_HELP_KEY, get_help_msg,
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&browser_list, NANO_EXIT_KEY, exit_msg, sc_init_one(&browser_list, NANO_EXIT_KEY, exit_msg,
IFHELP(nano_exitbrowser_msg, NANO_NO_KEY), NANO_EXIT_FKEY, IFHELP(nano_exitbrowser_msg, FALSE), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_EXIT_FKEY, NANO_NO_KEY, VIEW, NULL);
sc_init_one(&browser_list, NANO_PREVPAGE_KEY, prev_page_msg, sc_init_one(&browser_list, NANO_PREVPAGE_KEY, prev_page_msg,
IFHELP(nano_prevpage_msg, NANO_NO_KEY), NANO_PREVPAGE_FKEY, IFHELP(nano_prevpage_msg, FALSE), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_PREVPAGE_FKEY, NANO_NO_KEY, VIEW, NULL);
sc_init_one(&browser_list, NANO_NEXTPAGE_KEY, next_page_msg, sc_init_one(&browser_list, NANO_NEXTPAGE_KEY, next_page_msg,
IFHELP(nano_nextpage_msg, NANO_NO_KEY), NANO_NEXTPAGE_FKEY, IFHELP(nano_nextpage_msg, FALSE), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_NEXTPAGE_FKEY, NANO_NO_KEY, VIEW, NULL);
sc_init_one(&browser_list, NANO_WHEREIS_KEY, whereis_msg, sc_init_one(&browser_list, NANO_WHEREIS_KEY, whereis_msg,
IFHELP(nano_whereis_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_whereis_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&browser_list, NANO_NO_KEY, whereis_next_msg, sc_init_one(&browser_list, NANO_NO_KEY, whereis_next_msg,
IFHELP(nano_whereis_next_msg, NANO_WHEREIS_NEXT_KEY), IFHELP(nano_whereis_next_msg, FALSE), NANO_WHEREIS_NEXT_KEY,
NANO_WHEREIS_NEXT_FKEY, NANO_NO_KEY, VIEW, NULL); NANO_WHEREIS_NEXT_FKEY, NANO_NO_KEY, VIEW, NULL);
/* TRANSLATORS: Try to keep this at most 22 characters. */ /* TRANSLATORS: Try to keep this at most 22 characters. */
sc_init_one(&browser_list, NANO_GOTOLINE_KEY, N_("Go To Dir"), sc_init_one(&browser_list, NANO_GOTOLINE_KEY, N_("Go To Dir"),
IFHELP(nano_gotodir_msg, NANO_GOTOLINE_ALTKEY), IFHELP(nano_gotodir_msg, FALSE), NANO_GOTOLINE_ALTKEY,
NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, NULL); NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, NULL);
free_shortcutage(&whereis_file_list); free_shortcutage(&whereis_file_list);
sc_init_one(&whereis_file_list, NANO_HELP_KEY, get_help_msg, sc_init_one(&whereis_file_list, NANO_HELP_KEY, get_help_msg,
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY,
VIEW, NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
do_browser_help do_browser_help
#else #else
...@@ -1122,45 +1106,45 @@ void shortcut_init(bool unjustify) ...@@ -1122,45 +1106,45 @@ void shortcut_init(bool unjustify)
); );
sc_init_one(&whereis_file_list, NANO_CANCEL_KEY, cancel_msg, sc_init_one(&whereis_file_list, NANO_CANCEL_KEY, cancel_msg,
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&whereis_file_list, NANO_FIRSTFILE_KEY, first_file_msg, sc_init_one(&whereis_file_list, NANO_FIRSTFILE_KEY, first_file_msg,
IFHELP(nano_firstfile_msg, NANO_FIRSTFILE_ALTKEY), IFHELP(nano_firstfile_msg, FALSE), NANO_FIRSTFILE_ALTKEY,
NANO_FIRSTFILE_FKEY, NANO_FIRSTFILE_ALTKEY2, VIEW, NANO_FIRSTFILE_FKEY, NANO_FIRSTFILE_ALTKEY2, VIEW,
do_first_file); do_first_file);
sc_init_one(&whereis_file_list, NANO_LASTFILE_KEY, last_file_msg, sc_init_one(&whereis_file_list, NANO_LASTFILE_KEY, last_file_msg,
IFHELP(nano_lastfile_msg, NANO_LASTFILE_ALTKEY), IFHELP(nano_lastfile_msg, FALSE), NANO_LASTFILE_ALTKEY,
NANO_LASTFILE_FKEY, NANO_LASTFILE_ALTKEY2, VIEW, do_last_file); NANO_LASTFILE_FKEY, NANO_LASTFILE_ALTKEY2, VIEW, do_last_file);
#ifndef NANO_SMALL #ifndef NANO_SMALL
sc_init_one(&whereis_file_list, NANO_NO_KEY, case_sens_msg, sc_init_one(&whereis_file_list, NANO_NO_KEY, case_sens_msg,
IFHELP(nano_case_msg, TOGGLE_CASE_KEY), NANO_NO_KEY, IFHELP(nano_case_msg, FALSE), TOGGLE_CASE_KEY, NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
sc_init_one(&whereis_file_list, NANO_NO_KEY, backwards_msg, sc_init_one(&whereis_file_list, NANO_NO_KEY, backwards_msg,
IFHELP(nano_reverse_msg, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY, IFHELP(nano_reverse_msg, FALSE), TOGGLE_BACKWARDS_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
#endif #endif
#ifdef HAVE_REGEX_H #ifdef HAVE_REGEX_H
sc_init_one(&whereis_file_list, NANO_NO_KEY, regexp_msg, sc_init_one(&whereis_file_list, NANO_NO_KEY, regexp_msg,
IFHELP(nano_regexp_msg, NANO_REGEXP_KEY), NANO_NO_KEY, IFHELP(nano_regexp_msg, FALSE), NANO_REGEXP_KEY, NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
#endif #endif
#ifndef NANO_SMALL #ifndef NANO_SMALL
sc_init_one(&whereis_file_list, NANO_PREVLINE_KEY, history_msg, sc_init_one(&whereis_file_list, NANO_PREVLINE_KEY, history_msg,
IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_history_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
#endif #endif
free_shortcutage(&gotodir_list); free_shortcutage(&gotodir_list);
sc_init_one(&gotodir_list, NANO_HELP_KEY, get_help_msg, sc_init_one(&gotodir_list, NANO_HELP_KEY, get_help_msg,
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, NANO_NO_KEY, IFHELP(nano_help_msg, FALSE), NANO_NO_KEY, NANO_HELP_FKEY,
VIEW, NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
do_help_void do_help_void
#else #else
...@@ -1169,8 +1153,8 @@ void shortcut_init(bool unjustify) ...@@ -1169,8 +1153,8 @@ void shortcut_init(bool unjustify)
); );
sc_init_one(&gotodir_list, NANO_CANCEL_KEY, cancel_msg, sc_init_one(&gotodir_list, NANO_CANCEL_KEY, cancel_msg,
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, IFHELP(nano_cancel_msg, FALSE), NANO_NO_KEY, NANO_NO_KEY,
VIEW, NULL); NANO_NO_KEY, VIEW, NULL);
#endif #endif
currshortcut = main_list; currshortcut = main_list;
...@@ -1194,7 +1178,8 @@ void free_shortcutage(shortcut **shortcutage) ...@@ -1194,7 +1178,8 @@ void free_shortcutage(shortcut **shortcutage)
#ifndef NANO_TINY #ifndef NANO_TINY
/* Add a new toggle to the end of the global toggle list. */ /* Add a new toggle to the end of the global toggle list. */
void toggle_init_one(int val, const char *desc, long flag) void toggle_init_one(int val, const char *desc, bool blank_after, long
flag)
{ {
toggle *u; toggle *u;
...@@ -1210,6 +1195,7 @@ void toggle_init_one(int val, const char *desc, long flag) ...@@ -1210,6 +1195,7 @@ void toggle_init_one(int val, const char *desc, long flag)
u->val = val; u->val = val;
u->desc = (desc == NULL) ? "" : _(desc); u->desc = (desc == NULL) ? "" : _(desc);
u->blank_after = blank_after;
u->flag = flag; u->flag = flag;
u->next = NULL; u->next = NULL;
} }
...@@ -1222,59 +1208,48 @@ void toggle_init(void) ...@@ -1222,59 +1208,48 @@ void toggle_init(void)
if (toggles != NULL) if (toggles != NULL)
return; return;
toggle_init_one(TOGGLE_NOHELP_KEY, N_("Help mode"), NO_HELP); toggle_init_one(TOGGLE_NOHELP_KEY, N_("Help mode"), FALSE, NO_HELP);
toggle_init_one(TOGGLE_CONST_KEY, toggle_init_one(TOGGLE_CONST_KEY,
N_("Constant cursor position display"), CONST_UPDATE); N_("Constant cursor position display"), FALSE, CONST_UPDATE);
toggle_init_one(TOGGLE_MORESPACE_KEY, toggle_init_one(TOGGLE_MORESPACE_KEY,
N_("Use of more space for editing"), MORE_SPACE); N_("Use of more space for editing"), FALSE, MORE_SPACE);
toggle_init_one(TOGGLE_SMOOTH_KEY, N_("Smooth scrolling"), toggle_init_one(TOGGLE_SMOOTH_KEY, N_("Smooth scrolling"), FALSE,
SMOOTH_SCROLL); SMOOTH_SCROLL);
#ifdef ENABLE_NANORC #ifdef ENABLE_NANORC
toggle_init_one(TOGGLE_WHITESPACE_KEY, N_("Whitespace display"), toggle_init_one(TOGGLE_WHITESPACE_KEY, N_("Whitespace display"),
WHITESPACE_DISPLAY); FALSE, WHITESPACE_DISPLAY);
#endif #endif
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
toggle_init_one(TOGGLE_SYNTAX_KEY, N_("Color syntax highlighting"), toggle_init_one(TOGGLE_SYNTAX_KEY, N_("Color syntax highlighting"),
NO_COLOR_SYNTAX); TRUE, NO_COLOR_SYNTAX);
#endif
#ifndef DISABLE_HELP
/* This entry is blank, in order to make the help text easier to
* read. */
toggle_init_one(TOGGLE_NO_KEY, NULL, 0);
#endif #endif
toggle_init_one(TOGGLE_SMARTHOME_KEY, N_("Smart home key"), toggle_init_one(TOGGLE_SMARTHOME_KEY, N_("Smart home key"), FALSE,
SMART_HOME); SMART_HOME);
toggle_init_one(TOGGLE_AUTOINDENT_KEY, N_("Auto indent"), toggle_init_one(TOGGLE_AUTOINDENT_KEY, N_("Auto indent"), FALSE,
AUTOINDENT); AUTOINDENT);
toggle_init_one(TOGGLE_CUTTOEND_KEY, N_("Cut to end"), CUT_TO_END); toggle_init_one(TOGGLE_CUTTOEND_KEY, N_("Cut to end"), FALSE,
CUT_TO_END);
#ifndef DISABLE_WRAPPING #ifndef DISABLE_WRAPPING
toggle_init_one(TOGGLE_WRAP_KEY, N_("Long line wrapping"), toggle_init_one(TOGGLE_WRAP_KEY, N_("Long line wrapping"), FALSE,
NO_WRAP); NO_WRAP);
#endif #endif
toggle_init_one(TOGGLE_TABSTOSPACES_KEY, toggle_init_one(TOGGLE_TABSTOSPACES_KEY,
N_("Conversion of typed tabs to spaces"), TABS_TO_SPACES); N_("Conversion of typed tabs to spaces"), TRUE, TABS_TO_SPACES);
#ifndef DISABLE_HELP
/* This entry is blank, in order to make the help text easier to
* read. */
toggle_init_one(TOGGLE_NO_KEY, NULL, 0);
#endif
/* If we're using restricted mode, the backup toggle is disabled. /* If we're using restricted mode, the backup toggle is disabled.
* It's useless since backups are disabled. */ * It's useless since backups are disabled. */
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
toggle_init_one(TOGGLE_BACKUP_KEY, N_("Backup files"), toggle_init_one(TOGGLE_BACKUP_KEY, N_("Backup files"), FALSE,
BACKUP_FILE); BACKUP_FILE);
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
...@@ -1282,23 +1257,26 @@ void toggle_init(void) ...@@ -1282,23 +1257,26 @@ void toggle_init(void)
* disabled. It's useless since inserting files is disabled. */ * disabled. It's useless since inserting files is disabled. */
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
toggle_init_one(TOGGLE_MULTIBUFFER_KEY, toggle_init_one(TOGGLE_MULTIBUFFER_KEY,
N_("Multiple file buffers"), MULTIBUFFER); N_("Multiple file buffers"), FALSE, MULTIBUFFER);
#endif #endif
#ifndef DISABLE_MOUSE #ifndef DISABLE_MOUSE
toggle_init_one(TOGGLE_MOUSE_KEY, N_("Mouse support"), USE_MOUSE); toggle_init_one(TOGGLE_MOUSE_KEY, N_("Mouse support"), FALSE,
USE_MOUSE);
#endif #endif
/* If we're using restricted mode, the DOS/Mac conversion toggle is /* If we're using restricted mode, the DOS/Mac conversion toggle is
* disabled. It's useless since inserting files is disabled. */ * disabled. It's useless since inserting files is disabled. */
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
toggle_init_one(TOGGLE_NOCONVERT_KEY, toggle_init_one(TOGGLE_NOCONVERT_KEY,
N_("No conversion from DOS/Mac format"), NO_CONVERT); N_("No conversion from DOS/Mac format"), FALSE,
NO_CONVERT);
/* If we're using restricted mode, the suspend toggle is disabled. /* If we're using restricted mode, the suspend toggle is disabled.
* It's useless since suspending is disabled. */ * It's useless since suspending is disabled. */
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
toggle_init_one(TOGGLE_SUSPEND_KEY, N_("Suspend"), SUSPEND); toggle_init_one(TOGGLE_SUSPEND_KEY, N_("Suspend"), FALSE,
SUSPEND);
} }
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */
......
...@@ -364,21 +364,21 @@ void help_init(void) ...@@ -364,21 +364,21 @@ void help_init(void)
allocsize += strlen(htx[2]); allocsize += strlen(htx[2]);
/* The space needed for the shortcut lists, at most COLS characters, /* The space needed for the shortcut lists, at most COLS characters,
* plus '\n'. */ * plus one or two '\n's. */
allocsize += (COLS < 24 ? (24 * mb_cur_max()) : allocsize += (COLS < 24 ? (24 * mb_cur_max()) :
((COLS + 1) * mb_cur_max())) * length_of_list(currshortcut); ((COLS + 2) * mb_cur_max())) * length_of_list(currshortcut);
#ifndef NANO_TINY #ifndef NANO_TINY
/* If we're on the main list, we also count the toggle help text. /* If we're on the main list, we also count the toggle help text.
* Each non-blank entry has "M-%c\t\t\t", which fills 24 columns, * Each non-blank entry has "M-%c\t\t\t", which fills 24 columns,
* plus a space, plus translated text, plus '\n'. Each blank entry * plus a space, plus translated text, plus one or two '\n's. Each
* has just '\n'. */ * blank entry has just one or two '\n's. */
if (currshortcut == main_list) { if (currshortcut == main_list) {
size_t endis_len = strlen(_("enable/disable")); size_t endis_len = strlen(_("enable/disable"));
for (t = toggles; t != NULL; t = t->next) for (t = toggles; t != NULL; t = t->next)
if (t->val != TOGGLE_NO_KEY) if (t->val != TOGGLE_NO_KEY)
allocsize += strlen(t->desc) + endis_len + 7; allocsize += strlen(t->desc) + endis_len + 8;
allocsize++; allocsize++;
} }
#endif #endif
...@@ -488,8 +488,6 @@ void help_init(void) ...@@ -488,8 +488,6 @@ void help_init(void)
} }
} }
assert(s->help != NULL);
if (COLS > 24) { if (COLS > 24) {
char *help_ptr = display_string(s->help, 0, COLS - 24, char *help_ptr = display_string(s->help, 0, COLS - 24,
FALSE); FALSE);
...@@ -500,18 +498,22 @@ void help_init(void) ...@@ -500,18 +498,22 @@ void help_init(void)
} }
ptr += sprintf(ptr, "\n"); ptr += sprintf(ptr, "\n");
if (s->blank_after)
ptr += sprintf(ptr, "\n");
} }
#ifndef NANO_TINY #ifndef NANO_TINY
/* And the toggles... */ /* And the toggles... */
if (currshortcut == main_list) { if (currshortcut == main_list) {
for (t = toggles; t != NULL; t = t->next) { for (t = toggles; t != NULL; t = t->next) {
assert(t->desc != NULL);
if (t->val != TOGGLE_NO_KEY) if (t->val != TOGGLE_NO_KEY)
ptr += sprintf(ptr, "M-%c\t\t\t%s %s", ptr += sprintf(ptr, "M-%c\t\t\t%s %s",
toupper(t->val), t->desc, _("enable/disable")); toupper(t->val), t->desc, _("enable/disable"));
ptr += sprintf(ptr, "\n"); ptr += sprintf(ptr, "\n");
if (t->blank_after)
ptr += sprintf(ptr, "\n");
} }
} }
......
...@@ -290,6 +290,15 @@ typedef struct openfilestruct { ...@@ -290,6 +290,15 @@ typedef struct openfilestruct {
} openfilestruct; } openfilestruct;
typedef struct shortcut { typedef struct shortcut {
const char *desc;
/* The function's description, e.g. "Page Up". */
#ifndef DISABLE_HELP
const char *help;
/* The help file entry text for this function. */
#endif
bool blank_after;
/* Whether there should be a blank line after the help entry
* text for this function. */
/* Key values that aren't used should be set to NANO_NO_KEY. */ /* Key values that aren't used should be set to NANO_NO_KEY. */
int ctrlval; int ctrlval;
/* The special sentinel key or control key we want bound, if /* The special sentinel key or control key we want bound, if
...@@ -304,12 +313,6 @@ typedef struct shortcut { ...@@ -304,12 +313,6 @@ typedef struct shortcut {
/* Is this function allowed when in view mode? */ /* Is this function allowed when in view mode? */
void (*func)(void); void (*func)(void);
/* The function to call when we get this key. */ /* The function to call when we get this key. */
const char *desc;
/* The function's description, e.g. "Page Up". */
#ifndef DISABLE_HELP
const char *help;
/* The help file entry text for this function. */
#endif
struct shortcut *next; struct shortcut *next;
/* Next shortcut. */ /* Next shortcut. */
} shortcut; } shortcut;
...@@ -319,8 +322,11 @@ typedef struct toggle { ...@@ -319,8 +322,11 @@ typedef struct toggle {
int val; int val;
/* The sequence to toggle the key. We should only need one. */ /* The sequence to toggle the key. We should only need one. */
const char *desc; const char *desc;
/* The description for when the toggle is, uh, toggled, e.g. /* The description of the toggle, e.g. "Cut to end"; we'll
* "Cut to end"; we'll append Enabled or Disabled. */ * append Enabled or Disabled to it. */
bool blank_after;
/* Whether there should be a blank line after the description of
* the toggle. */
long flag; long flag;
/* Which flag actually gets toggled. */ /* Which flag actually gets toggled. */
struct toggle *next; struct toggle *next;
...@@ -550,11 +556,11 @@ typedef struct rcoption { ...@@ -550,11 +556,11 @@ typedef struct rcoption {
#define NANO_CUTTILLEND_KEY NANO_CONTROL_X #define NANO_CUTTILLEND_KEY NANO_CONTROL_X
#define NANO_CUTTILLEND_ALTKEY NANO_ALT_T #define NANO_CUTTILLEND_ALTKEY NANO_ALT_T
#define NANO_PARABEGIN_KEY NANO_CONTROL_W #define NANO_PARABEGIN_KEY NANO_CONTROL_W
#define NANO_PARABEGIN_ALTKEY1 NANO_ALT_LPAREN #define NANO_PARABEGIN_ALTKEY NANO_ALT_LPAREN
#define NANO_PARABEGIN_ALTKEY2 NANO_ALT_9 #define NANO_PARABEGIN_ALTKEY NANO_ALT_9
#define NANO_PARAEND_KEY NANO_CONTROL_O #define NANO_PARAEND_KEY NANO_CONTROL_O
#define NANO_PARAEND_ALTKEY1 NANO_ALT_RPAREN #define NANO_PARAEND_ALTKEY NANO_ALT_RPAREN
#define NANO_PARAEND_ALTKEY2 NANO_ALT_0 #define NANO_PARAEND_ALTKEY NANO_ALT_0
#define NANO_FULLJUSTIFY_KEY NANO_CONTROL_U #define NANO_FULLJUSTIFY_KEY NANO_CONTROL_U
#define NANO_FULLJUSTIFY_ALTKEY NANO_ALT_J #define NANO_FULLJUSTIFY_ALTKEY NANO_ALT_J
#define NANO_VERBATIM_KEY NANO_ALT_V #define NANO_VERBATIM_KEY NANO_ALT_V
......
...@@ -327,15 +327,16 @@ void save_history(void); ...@@ -327,15 +327,16 @@ void save_history(void);
/* Public functions in global.c. */ /* Public functions in global.c. */
size_t length_of_list(const shortcut *s); size_t length_of_list(const shortcut *s);
#ifndef NANO_TINY #ifndef NANO_TINY
void toggle_init_one(int val, const char *desc, long flag); void toggle_init_one(int val, const char *desc, bool blank_after, long
flag);
void toggle_init(void); void toggle_init(void);
#endif #endif
void sc_init_one(shortcut **shortcutage, int key, const char *desc, void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
const char *help, const char *help,
#endif #endif
int metaval, int funcval, int miscval, bool view, void bool blank_after, int metaval, int funcval, int miscval, bool
(*func)(void)); view, void (*func)(void));
void shortcut_init(bool unjustify); void shortcut_init(bool unjustify);
void free_shortcutage(shortcut **shortcutage); void free_shortcutage(shortcut **shortcutage);
#ifdef DEBUG #ifdef DEBUG
......
...@@ -1713,11 +1713,7 @@ const toggle *get_toggle(int kbinput, bool meta_key) ...@@ -1713,11 +1713,7 @@ const toggle *get_toggle(int kbinput, bool meta_key)
for (; t != NULL; t = t->next) { for (; t != NULL; t = t->next) {
/* We've found a toggle if the key exists, meta_key is TRUE, and /* We've found a toggle if the key exists, meta_key is TRUE, and
* the key is in the meta key toggle list. */ * the key is in the meta key toggle list. */
if ( if (t->val != TOGGLE_NO_KEY && meta_key && kbinput == t->val)
#ifndef DISABLE_HELP
t->val != TOGGLE_NO_KEY &&
#endif
meta_key && kbinput == t->val)
break; break;
} }
......
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