diff --git a/src/keyboard.c b/src/keyboard.c index bf1f5da22d..3ea8ba7619 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -281,7 +281,7 @@ #define GROW_RAW_KEYBUF \ with the input rate, but if it can keep up just enough that there's no input_pending when we begin the command, then redisplay is not skipped which results in better feedback to the user. */ -static bool input_was_pending; +bool input_was_pending; /* Circular buffer for pre-read keyboard input. */ diff --git a/src/window.c b/src/window.c index ff17cd88f3..5e61d9f528 100644 --- a/src/window.c +++ b/src/window.c @@ -5466,6 +5466,8 @@ window_internal_height (struct window *w) means don't signal an error if we try to move over BEGV or ZV, respectively. */ +extern bool input_was_pending; + static void window_scroll (Lisp_Object window, EMACS_INT n, bool whole, bool noerror) { @@ -5475,8 +5477,15 @@ window_scroll (Lisp_Object window, EMACS_INT n, bool whole, bool noerror) wset_redisplay (XWINDOW (window)); - if (whole && Vfast_but_imprecise_scrolling) - specbind (Qfontification_functions, Qnil); + if (Vfast_but_imprecise_scrolling) + { + if (input_was_pending) + specbind (Qfontification_functions, Qnil); + } + else + { + input_was_pending = false; + } /* On GUI frames, use the pixel-based version which is much slower than the line-based one but can handle varying line heights. */