add function key aliases for NANO_FIRSTLINE_KEY and NANO_LASTLINE_KEY,

and make sure statusbar input handles both them and NANO_HELP_FKEY
properly


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1682 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2004-03-04 19:30:53 +00:00
parent a619ae69bf
commit d7f5ad9786
4 changed files with 14 additions and 4 deletions

View File

@ -11,7 +11,9 @@ CVS code -
NANO_DOWN_KEY in the search history shortcut entries. (DLR) NANO_DOWN_KEY in the search history shortcut entries. (DLR)
- Add NANO_UNJUSTIFY_FKEY (the same as NANO_UNCUT_FKEY) to the - Add NANO_UNJUSTIFY_FKEY (the same as NANO_UNCUT_FKEY) to the
shortcut list, and tweak the unjustify routine to use it. shortcut list, and tweak the unjustify routine to use it.
(DLR) Also add NANO_FIRSTLINE_FKEY and NANO_LASTLINE_FKEY, and tweak
the statusbar input routines to handle them and NANO_HELP_FKEY
properly. (DLR)
- Add more intuitive Meta-key aliases for moving to the - Add more intuitive Meta-key aliases for moving to the
beginning and ending lines of a paragraph at the search beginning and ending lines of a paragraph at the search
prompt: Meta-P and Meta-N. (DLR) prompt: Meta-P and Meta-N. (DLR)

View File

@ -619,12 +619,12 @@ void shortcut_init(int unjustify)
/* Translators: try to keep this string under 10 characters long */ /* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_FIRSTLINE_KEY, _("First Line"), sc_init_one(&whereis_list, NANO_FIRSTLINE_KEY, _("First Line"),
IFHELP(nano_firstline_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_firstline_msg, NANO_NO_KEY), NANO_FIRSTLINE_FKEY,
NANO_NO_KEY, VIEW, do_first_line); NANO_NO_KEY, VIEW, do_first_line);
/* Translators: try to keep this string under 10 characters long */ /* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_LASTLINE_KEY, _("Last Line"), sc_init_one(&whereis_list, NANO_LASTLINE_KEY, _("Last Line"),
IFHELP(nano_lastline_msg, NANO_NO_KEY), NANO_NO_KEY, IFHELP(nano_lastline_msg, NANO_NO_KEY), NANO_LASTLINE_FKEY,
NANO_NO_KEY, VIEW, do_last_line); NANO_NO_KEY, VIEW, do_last_line);
/* Translators: try to keep this string under 10 characters long */ /* Translators: try to keep this string under 10 characters long */

View File

@ -407,7 +407,9 @@ typedef struct historyheadtype {
#define NANO_SPELL_KEY NANO_CONTROL_T #define NANO_SPELL_KEY NANO_CONTROL_T
#define NANO_SPELL_FKEY KEY_F(12) #define NANO_SPELL_FKEY KEY_F(12)
#define NANO_FIRSTLINE_KEY NANO_PREVPAGE_KEY #define NANO_FIRSTLINE_KEY NANO_PREVPAGE_KEY
#define NANO_FIRSTLINE_FKEY NANO_PREVPAGE_FKEY
#define NANO_LASTLINE_KEY NANO_NEXTPAGE_KEY #define NANO_LASTLINE_KEY NANO_NEXTPAGE_KEY
#define NANO_LASTLINE_FKEY NANO_NEXTPAGE_FKEY
#define NANO_CANCEL_KEY NANO_CONTROL_C #define NANO_CANCEL_KEY NANO_CONTROL_C
#define NANO_REFRESH_KEY NANO_CONTROL_L #define NANO_REFRESH_KEY NANO_CONTROL_L
#define NANO_JUSTIFY_KEY NANO_CONTROL_J #define NANO_JUSTIFY_KEY NANO_CONTROL_J

View File

@ -1135,12 +1135,16 @@ int nanogetstr(int allowtabs, const char *buf, const char *def,
fprintf(stderr, "Aha! \'%c\' (%d)\n", kbinput, kbinput); fprintf(stderr, "Aha! \'%c\' (%d)\n", kbinput, kbinput);
#endif #endif
if (kbinput == t->func_key)
kbinput = t->val;
if (kbinput == t->val && is_cntrl_char(kbinput)) { if (kbinput == t->val && is_cntrl_char(kbinput)) {
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
/* Have to do this here, it would be too late to do it /* Have to do this here, it would be too late to do it
in statusq() */ in statusq() */
if (kbinput == NANO_HELP_KEY || kbinput == NANO_HELP_FKEY) { if (kbinput == NANO_HELP_KEY) {
kbinput = NANO_HELP_KEY;
do_help(); do_help();
break; break;
} }
@ -2042,10 +2046,12 @@ int statusq(int tabs, const shortcut *s, const char *def,
switch (ret) { switch (ret) {
case NANO_FIRSTLINE_KEY: case NANO_FIRSTLINE_KEY:
case NANO_FIRSTLINE_FKEY:
do_first_line(); do_first_line();
resetstatuspos = 1; resetstatuspos = 1;
break; break;
case NANO_LASTLINE_KEY: case NANO_LASTLINE_KEY:
case NANO_LASTLINE_FKEY:
do_last_line(); do_last_line();
resetstatuspos = 1; resetstatuspos = 1;
break; break;