diff --git a/ChangeLog b/ChangeLog index d4103637692c864948b76e7e20e106f1ac6c824e..e122cf65ac42b7ffde321ce43f7b1fe22eb317c0 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 cd9a4372573e04063df1e93cf961c3ca5682469b..62eb4be09bc50ef61deaf3054e689c27fd01c399 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 9adc27840d83600f83d2c06f8ceb10544e69dc45..f6af80a7189b431e0c7449e0d8ee3e366ec61cbc 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 d9564033c71f64f41abe543ed97dae99bbdc4ebb..f155bd23dc158305ecf6675d6f6070d9c0e8ccbc 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;