]> git.wh0rd.org Git - nano.git/commitdiff
main() - Added Alt-[-[-7,8 support for home/end keys (Jeff Teunissen).
authorChris Allegretta <chrisa@asty.org>
Wed, 4 Jul 2001 16:06:21 +0000 (16:06 +0000)
committerChris Allegretta <chrisa@asty.org>
Wed, 4 Jul 2001 16:06:21 +0000 (16:06 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_1_0_branch/nano@718 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
nano.c

index 0559e170bb268847443f1cbf6abd197c8f336b30..bff1d91aafe92e1aa16d5053c4c73dd10f9c10c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@ CVS code -
   do_browser()
        - More Picoish keystrokes for the browser, ^P, ^N, etc, for up,
          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).
 - THANKS:
        - Added some more people.
 - po/gl.po:
diff --git a/nano.c b/nano.c
index a495a4c07e692c574b910f0b847ce14f1fe7e324..058b71d6b4711249354137ed5012a8abaf83772e 100644 (file)
--- a/nano.c
+++ b/nano.c
@@ -2535,8 +2535,27 @@ int main(int argc, char *argv[])
                    break;
                case '[':       /* Alt-[-[-[A-E], F1-F5 in linux console */
                    kbinput = wgetch(edit);
-                   if (kbinput >= 'A' && kbinput <= 'E')
+                   switch(kbinput) {
+                   case 'A':
+                   case 'B':
+                   case 'C':
+                   case 'D':
+                   case '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':