From 217e94e4c9f4755e03b07b69df806163d0d2487e Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Wed, 4 Jul 2001 16:27:05 +0000 Subject: [PATCH] Oops, make that Alt-[-7.8 git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_1_0_branch/nano@719 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 2 +- nano.c | 29 +++++++++-------------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index bff1d91a..f492f713 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,7 @@ CVS code - down, etc, and add the consistent ^C to exit (Jim Knoble). - nano.c: main() - - Added Alt-[-[-7,8 support for home/end keys (Jeff Teunissen). + - Added Alt-[-7,8 support for home/end keys (Jeff Teunissen). - THANKS: - Added some more people. - po/gl.po: diff --git a/nano.c b/nano.c index 058b71d6..bfe3e024 100644 --- a/nano.c +++ b/nano.c @@ -2533,29 +2533,18 @@ int main(int argc, char *argv[]) kbinput = KEY_NPAGE; wgetch(edit); break; + case '7': + kbinput = KEY_HOME; + wgetch(edit); + break; + case '8': + kbinput = KEY_END; + wgetch(edit); + break; case '[': /* Alt-[-[-[A-E], F1-F5 in linux console */ kbinput = wgetch(edit); - switch(kbinput) { - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': + if (kbinput >= 'A' && kbinput <= 'E') kbinput = KEY_F(kbinput - 64); - break; - case 7: - kbinput = KEY_HOME; - break; - case 8: - kbinput = KEY_END; - break; -#ifdef DEBUG - default: - fprintf(stderr, _("I got Alt-[-[-%c! (%d)\n"), - kbinput, kbinput); - break; -#endif - } break; case 'A': case 'B': -- 2.39.5