emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/tzz/auth-source-reveal-mode 1ffabf9 1/3: lisp/progmodes/prog-mod


From: Teodor Zlatanov
Subject: scratch/tzz/auth-source-reveal-mode 1ffabf9 1/3: lisp/progmodes/prog-mode.el: prevent font-lock-flush boundary errors
Date: Mon, 22 Jun 2020 15:16:55 -0400 (EDT)

branch: scratch/tzz/auth-source-reveal-mode
commit 1ffabf99eda18f30c2931254bf78ba3ca7b4d1d2
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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]