main() alt val - 32 check fix, and shortcut_init() fix in global.c for hard coded values

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@986 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Chris Allegretta 2002-01-07 16:43:25 +00:00
parent d39698ff1f
commit f7dee92189
3 changed files with 11 additions and 3 deletions

View File

@ -2,6 +2,13 @@ CVS code -
- nano.c:
usage()
- Remove extra \n in --keypad description (Jordi).
main()
- Check that alt value is an alpha char before comparing to
val - 32, fixes Alt-R calling doprev instead of replace.
- global.c:
shorcut_init()
- Replace hard coded ALT_G and ALT_H values in the replace
and goto shortcuts with their macro counterparts NANO_ALT_*_KEY.
- winio.c:
edit_refresh()
- Rename lines to nlines to fix AIX breakage (reported by

View File

@ -352,7 +352,7 @@ void shortcut_init(int unjustify)
else
sc_init_one(&main_list[4], NANO_REPLACE_KEY, _("Replace"),
nano_replace_msg,
NANO_ALT_R, NANO_REPLACE_FKEY, 0, NOVIEW, do_replace);
NANO_ALT_REPLACE_KEY, NANO_REPLACE_FKEY, 0, NOVIEW, do_replace);
sc_init_one(&main_list[5], NANO_WHEREIS_KEY, _("Where Is"),
nano_whereis_msg,
@ -435,7 +435,7 @@ void shortcut_init(int unjustify)
sc_init_one(&main_list[25], NANO_GOTO_KEY, _("Goto Line"),
nano_goto_msg,
NANO_ALT_G, NANO_GOTO_FKEY, 0, VIEW, do_gotoline_void);
NANO_ALT_GOTO_KEY, NANO_GOTO_FKEY, 0, VIEW, do_gotoline_void);
#if (!defined NANO_SMALL) && (defined HAVE_REGEX_H)
sc_init_one(&main_list[26], -9, _("Find Other Bracket"),

3
nano.c
View File

@ -3173,7 +3173,8 @@ int main(int argc, char *argv[])
/* And for toggle switches */
for (i = 0; i <= TOGGLE_LEN - 1 && !keyhandled; i++)
if (kbinput == toggles[i].val ||
kbinput == toggles[i].val - 32) {
(toggles[i].val > 'a' &&
kbinput == toggles[i].val - 32)) {
do_toggle(i);
keyhandled = 1;
break;