]> git.wh0rd.org Git - nano.git/commitdiff
a few minor fixes for low-level keyboard input
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 16 Sep 2003 01:22:31 +0000 (01:22 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 16 Sep 2003 01:22:31 +0000 (01:22 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1553 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/winio.c

index 2b6ce6e361203206330e519ed47ae8f3ed5c326f..c8e94d0b5106d6a40eb54bc194482e533e00e083 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -110,6 +110,14 @@ CVS code -
        - Make sure all rcfile error messages are capitalized, for
          consistency. (DLR)
 - winio.c:
+  get_verbatim_kbinput()
+       - Fix a silly memory corruption bug that would occur when trying
+         to read a sequence of more than one key verbatim. (DLR)
+  get_accepted_kbinput()
+         Handle Ctrl-{ to Ctrl-~ correctly, and drop support for
+         converting Esc ` to Esc Space, since making Meta-[key]
+         correspond to Ctrl-[key] in all cases is inconsistent due to
+         the different natures of Contol and Meta key sequences. (DLR)
   do_first_line()
        - Call edit_update() with TOP instead of CENTER; both do the
          same thing, but it works faster with TOP. (DLR)
index 74f368ba86bcefc1b303c42c26f5bbf195f7bb09..8318c31bd7dfaf8c0891854f61e9a072cccb4e97 100644 (file)
@@ -67,7 +67,7 @@ char *get_verbatim_kbinput(WINDOW *win, int *kbinput_len)
     else {
        nodelay(win, TRUE);
        while ((kbinput = wgetch(win)) != ERR) {
-           *kbinput_len++;
+           (*kbinput_len)++;
            verbatim_kbinput = charealloc(verbatim_kbinput, *kbinput_len);
            verbatim_kbinput[*kbinput_len - 1] = (char)kbinput;
        }
@@ -139,8 +139,8 @@ int get_accepted_kbinput(WINDOW *win, int kbinput, int *meta,
                    /* Ctrl-A to Ctrl-_ */
                    else if (kbinput >= 'A' && kbinput <= '_')
                        kbinput -= 64;
-                   /* Ctrl-A to Ctrl-Z */
-                   else if (kbinput >= 'a' && kbinput <= 'z')
+                   /* Ctrl-A to Ctrl-~ */
+                   else if (kbinput >= 'a' && kbinput <= '~')
                        kbinput -= 96;
                    break;
                /* Terminal breakage, part 1: We shouldn't get an escape
@@ -160,14 +160,9 @@ int get_accepted_kbinput(WINDOW *win, int kbinput, int *meta,
                    }
                    nodelay(win, FALSE);
                    break;
-               case '`':
-                   /* Esc Space == Esc ` */
-                   kbinput = ' ';
-                   break;
                default:
                    /* Esc [character] == Meta-[character] */
-                   if (isupper(kbinput))
-                       kbinput = tolower(kbinput);
+                   kbinput = tolower(kbinput);
                    *meta = 1;
            }
            break;
@@ -418,7 +413,6 @@ void blank_edit(void)
        mvwaddstr(edit, i, 0, hblank);
 }
 
-
 void blank_statusbar(void)
 {
     mvwaddstr(bottomwin, 0, 0, hblank);