nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 9875252fd7f1daedc7141353d54bdbdb898e0bcb
parent 1551c1c77163bf8d78070568e25875bead02faac
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 10 Aug 2020 11:55:56 +0200

tweaks: remove an unneeded beep, and reshuffle the lines for compactness

The beep is produced later, after get_verbatim_kbinput() returns.

Diffstat:
Msrc/winio.c | 8+++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -1460,13 +1460,11 @@ char *get_verbatim_kbinput(WINDOW *win, size_t *count) /* If the byte is invalid in the current mode, discard it; * if it is an incomplete Unicode sequence, stuff it back. */ if (input != NULL) { - if ((*input == '\n' && as_an_at) || (*input == '\0' && !as_an_at)) { - *count = 0; - beep(); - } else if (*input >= 0x80 && *count == 1) { + if (*input >= 0x80 && *count == 1) { put_back(*input); *count = 999; - } + } else if ((*input == '\n' && as_an_at) || (*input == '\0' && !as_an_at)) + *count = 0; } #ifndef NANO_TINY