From 1ffabf99eda18f30c2931254bf78ba3ca7b4d1d2 Mon Sep 17 00:00:00 2001 From: Ted Zlatanov Date: Wed, 17 Jun 2020 10:28:27 -0400 Subject: [PATCH] lisp/progmodes/prog-mode.el: prevent font-lock-flush boundary errors --- lisp/progmodes/prog-mode.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index d3d3deae4b1..49ab9fc03fa 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -183,6 +183,11 @@ on the symbol." (> (point) (cadr prettify-symbols--current-symbol-bounds)) (and (not (eq prettify-symbols-unprettify-at-point 'right-edge)) (= (point) (cadr prettify-symbols--current-symbol-bounds))))) + ;; Adjust the bounds in case either end is invalid. + (setf (car prettify-symbols--current-symbol-bounds) + (max (car prettify-symbols--current-symbol-bounds) (point-min)) + (cadr prettify-symbols--current-symbol-bounds) + (min (cadr prettify-symbols--current-symbol-bounds) (point-max))) (apply #'font-lock-flush prettify-symbols--current-symbol-bounds) (setq prettify-symbols--current-symbol-bounds nil)) ;; Unprettify the current symbol. -- 2.39.2