[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/tzz/prettify-text-mode f8b4f20 1/3: lisp/progmodes/prog-mode.el:
From: |
Teodor Zlatanov |
Subject: |
scratch/tzz/prettify-text-mode f8b4f20 1/3: lisp/progmodes/prog-mode.el: prevent font-lock-flush boundary errors |
Date: |
Sun, 12 Jul 2020 16:44:56 -0400 (EDT) |
branch: scratch/tzz/prettify-text-mode
commit f8b4f204a545a3bead094a128d02824b9d8690f1
Author: Ted Zlatanov <tzz@lifelogs.com>
Commit: Ted Zlatanov <tzz@lifelogs.com>
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 d3d3dea..49ab9fc 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.