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
master
David Lawrence Ramsey 2006-04-27 23:39:49 +00:00
parent 9dd268730c
commit cf1879b706
4 changed files with 22 additions and 12 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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

View File

@ -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;