a few minor fixes for low-level keyboard input

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1553 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
David Lawrence Ramsey 2003-09-16 01:22:31 +00:00
parent 5ffbec56f6
commit da8fd8f894
2 changed files with 12 additions and 10 deletions

View File

@ -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)

View 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);