emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/rainbow-delimiters 2f17e9d735 053/188: Flush the ppss cach


From: ELPA Syncer
Subject: [nongnu] elpa/rainbow-delimiters 2f17e9d735 053/188: Flush the ppss cache on mode activation.
Date: Sat, 1 Jan 2022 00:58:52 -0500 (EST)

branch: elpa/rainbow-delimiters
commit 2f17e9d7354bb0285bbe5d6a784cabe32cfc2d6e
Author: Fanael Linithien <fanael4@gmail.com>
Commit: Fanael Linithien <fanael4@gmail.com>

    Flush the ppss cache on mode activation.
    
    This prevents the code from relying on stale cache if the mode
    has been deactivated, the buffer changed and the mode activated again.
---
 rainbow-delimiters.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rainbow-delimiters.el b/rainbow-delimiters.el
index 6c4f47036b..2e45225386 100644
--- a/rainbow-delimiters.el
+++ b/rainbow-delimiters.el
@@ -569,6 +569,8 @@ Used by jit-lock for dynamic highlighting."
         (remove-hook 'before-change-functions 
'rainbow-delimiters-syntax-ppss-flush-cache t)
         (jit-lock-unregister 'rainbow-delimiters-propertize-region)
         (rainbow-delimiters-unpropertize-region (point-min) (point-max)))
+    ;; Flush the ppss cache now in case there's something left in there.
+    (setq rainbow-delimiters-parse-partial-sexp-cache nil)
     (add-hook 'before-change-functions 
'rainbow-delimiters-syntax-ppss-flush-cache t t)
     (jit-lock-register 'rainbow-delimiters-propertize-region t)
     ;; Create necessary syntax tables inheriting from current major-mode.



reply via email to

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