From cf1879b706fa45bea4d2d5527cd97b77391e830f Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Thu, 27 Apr 2006 23:39:49 +0000 Subject: [PATCH] tweak the shortcut list a bit more, and add Space and - as aliases for PageDown and PageUp in the help browser, per Benno Schulenberg's suggestions git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3445 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 4 ++++ src/browser.c | 4 ++-- src/global.c | 14 +++++++------- src/help.c | 12 +++++++++--- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index d4103637..e122cf65 100644 --- a/ChangeLog +++ b/ChangeLog @@ -121,6 +121,10 @@ CVS code - - If we have at least two entries' worth of blank space, use it to display more of "^Space" and "M-Space". (DLR, suggested by Benno Schulenberg) + parse_help_input() + - Add Space and - as aliases for PageDown and PageUp, for + consistency with the file browser. (DLR, suggested by Benno + Schulenberg) - nano.c: renumber() - Remove invalid assert. (DLR, found by Filipe Moreira) diff --git a/src/browser.c b/src/browser.c index cd9a4372..62eb4be0 100644 --- a/src/browser.c +++ b/src/browser.c @@ -486,8 +486,8 @@ void browser_init(const char *path, DIR *dir) /* Determine the shortcut key corresponding to the values of kbinput * (the key itself), meta_key (whether the key is a meta sequence), and * func_key (whether the key is a function key), if any. In the - * process, convert certain non-shortcut keys used by e.g. Pico's file - * browser into their corresponding shortcut keys. */ + * process, convert certain non-shortcut keys into their corresponding + * shortcut keys. */ void parse_browser_input(int *kbinput, bool *meta_key, bool *func_key) { get_shortcut(browser_list, kbinput, meta_key, func_key); diff --git a/src/global.c b/src/global.c index 9adc2784..f6af80a7 100644 --- a/src/global.c +++ b/src/global.c @@ -336,6 +336,8 @@ void shortcut_init(bool unjustify) #ifndef NANO_TINY const char *nano_mark_msg = N_("Mark text at the cursor position"); const char *nano_whereis_next_msg = N_("Repeat last search"); + const char *nano_copy_msg = + N_("Copy the current line and store it in the cutbuffer"); #endif const char *nano_forward_msg = N_("Move forward one character"); const char *nano_back_msg = N_("Move back one character"); @@ -377,7 +379,7 @@ void shortcut_init(bool unjustify) const char *nano_tab_msg = N_("Insert a tab character at the cursor position"); const char *nano_enter_msg = - N_("Insert a new line at the cursor position"); + N_("Insert a newline at the cursor position"); const char *nano_delete_msg = N_("Delete the character under the cursor"); const char *nano_backspace_msg = @@ -392,8 +394,6 @@ void shortcut_init(bool unjustify) #ifndef NANO_TINY const char *nano_wordcount_msg = N_("Count the number of words, lines, and characters"); - const char *nano_copy_msg = - N_("Copy the current line and store it in the cutbuffer"); #endif const char *nano_refresh_msg = N_("Refresh (redraw) the current screen"); @@ -562,6 +562,10 @@ void shortcut_init(bool unjustify) sc_init_one(&main_list, NANO_NO_KEY, whereis_next_msg, IFHELP(nano_whereis_next_msg, TRUE), NANO_WHEREIS_NEXT_KEY, NANO_WHEREIS_NEXT_FKEY, NANO_NO_KEY, VIEW, do_research); + + sc_init_one(&main_list, NANO_NO_KEY, N_("Copy Text"), + IFHELP(nano_copy_msg, TRUE), NANO_COPY_KEY, NANO_NO_KEY, + NANO_COPY_ALTKEY, NOVIEW, do_copy_text); #endif sc_init_one(&main_list, NANO_FORWARD_KEY, N_("Forward"), @@ -682,10 +686,6 @@ void shortcut_init(bool unjustify) sc_init_one(&main_list, NANO_NO_KEY, N_("Word Count"), IFHELP(nano_wordcount_msg, FALSE), NANO_WORDCOUNT_KEY, NANO_NO_KEY, NANO_NO_KEY, VIEW, do_wordlinechar_count); - - sc_init_one(&main_list, NANO_NO_KEY, N_("Copy Text"), - IFHELP(nano_copy_msg, FALSE), NANO_COPY_KEY, NANO_NO_KEY, - NANO_COPY_ALTKEY, NOVIEW, do_copy_text); #endif sc_init_one(&main_list, NANO_REFRESH_KEY, refresh_msg diff --git a/src/help.c b/src/help.c index d9564033..f155bd23 100644 --- a/src/help.c +++ b/src/help.c @@ -549,15 +549,21 @@ void help_init(void) /* Determine the shortcut key corresponding to the values of kbinput * (the key itself), meta_key (whether the key is a meta sequence), and * func_key (whether the key is a function key), if any. In the - * process, convert certain non-shortcut keys used by e.g. Pico's help - * browser into their corresponding shortcut keys. */ + * process, convert certain non-shortcut keys into their corresponding + * shortcut keys. */ void parse_help_input(int *kbinput, bool *meta_key, bool *func_key) { get_shortcut(help_list, kbinput, meta_key, func_key); - /* Pico compatibility. */ if (*meta_key == FALSE && *func_key == FALSE) { switch (*kbinput) { + /* For consistency with the file browser. */ + case ' ': + *kbinput = NANO_NEXTPAGE_KEY; + break; + case '-': + *kbinput = NANO_PREVPAGE_KEY; + break; /* Cancel is equivalent to Exit here. */ case NANO_CANCEL_KEY: *kbinput = NANO_EXIT_KEY; -- 2.39.5