[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/tzz/auth-source-reveal-mode 48e57fa 1/3: lisp/progmodes/prog-mod
From: |
Teodor Zlatanov |
Subject: |
scratch/tzz/auth-source-reveal-mode 48e57fa 1/3: lisp/progmodes/prog-mode.el: prevent font-lock-flush boundary errors |
Date: |
Thu, 18 Jun 2020 14:34:37 -0400 (EDT) |
branch: scratch/tzz/auth-source-reveal-mode
commit 48e57fa82bf808d8972136849c9266b865f6fc89
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.