From d0abbf28576be00e33e56a6abf2e9e27ef02cb47 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 12 Jul 2019 19:42:43 +0100 Subject: [PATCH] Consider jit-lock-antiblink when fontifying "on demand" * lisp/jit-lock.el (jit-lock-function): Consider jit-lock--antiblink-grace-timer. --- lisp/jit-lock.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el index 7ae79f057b7..d881fb4b19f 100644 --- a/lisp/jit-lock.el +++ b/lisp/jit-lock.el @@ -362,7 +362,11 @@ is active." (or (not (eq jit-lock-defer-time 0)) (input-pending-p)))) ;; No deferral. - (jit-lock-fontify-now start (+ start jit-lock-chunk-size)) + (if jit-lock--antiblink-grace-timer + ;; If we're in the `jit-lock--antiblink-grace', do it only + ;; until line end + (jit-lock-fontify-now start (line-end-position)) + (jit-lock-fontify-now start (+ start jit-lock-chunk-size))) ;; Record the buffer for later fontification. (unless (memq (current-buffer) jit-lock-defer-buffers) (push (current-buffer) jit-lock-defer-buffers)) -- 2.39.5