commit 259a3c70e3522c78b36f95026eed88f3ddd02e23
parent 2445e775355f2571f41a7c32e8674df3510fcbf8
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 20 May 2024 16:08:29 +0200
general: disable the type-ahead checking that ncurses normally does
While updating the screen, ncurses by default polls the input source
now and then to see if there is new input, and if so, stops updating
the screen and waits for the next call of doupdate() or refresh().
https://lists.gnu.org/archive/html/bug-ncurses/2024-05/msg00077.html
Disable this polling, as it is just a waste of time, and there *might*
be situations where the intruding keystroke does not actually trigger
a new update, which could result in a half-updated screen.
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -2437,6 +2437,9 @@ int main(int argc, char **argv)
mousefocusin = get_keycode("kxIN", FOCUS_IN);
mousefocusout = get_keycode("kxOUT", FOCUS_OUT);
+ /* Disable the type-ahead checking that ncurses normally does. */
+ typeahead(-1);
+
#ifdef HAVE_SET_ESCDELAY
/* Tell ncurses to pass the Esc key quickly. */
set_escdelay(50);