diff --git a/src/nano.c b/src/nano.c index 91962adc..2e819e44 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1531,17 +1531,9 @@ void do_input(void) /* If we got a non-high-bit control key, a meta key sequence, or a * function key, and it's not a shortcut or toggle, throw it out. */ if (shortcut == NULL) { - if (input < 0x20 || input > 0xFF || meta_key) { + if (input < 0x20 || input > 0xFF || meta_key) unbound_key(input); - input = ERR; - } - } - - /* If the keystroke isn't a shortcut nor a toggle, it's a normal text - * character: add the character to the input buffer -- or display a - * warning when we're in view mode. */ - if (input != ERR && shortcut == NULL) { - if (ISSET(VIEW_MODE)) + else if (ISSET(VIEW_MODE)) print_view_warning(); else { /* Store the byte, and leave room for a terminating zero. */ diff --git a/src/prompt.c b/src/prompt.c index d863d5fd..aba8fc38 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -90,18 +90,11 @@ int do_statusbar_input(bool *finished) /* If we got a non-high-bit control key, a meta key sequence, or a * function key, and it's not a shortcut or toggle, throw it out. */ if (shortcut == NULL) { - if (input < 0x20 || input > 0xFF || meta_key) { + if (input < 0x20 || input > 0xFF || meta_key) beep(); - input = ERR; - } - } - - /* If the keystroke isn't a shortcut nor a toggle, it's a normal text - * character: add the it to the input buffer, when allowed. */ - if (input != ERR && shortcut == NULL) { /* Only accept input when not in restricted mode, or when not at * the "Write File" prompt, or when there is no filename yet. */ - if (!ISSET(RESTRICTED) || currmenu != MWRITEFILE || + else if (!ISSET(RESTRICTED) || currmenu != MWRITEFILE || openfile->filename[0] == '\0') { kbinput_len++; kbinput = (int *)nrealloc(kbinput, kbinput_len * sizeof(int));