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

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

[nongnu] elpa/eglot-inactive-regions badb4e403a 46/66: cleanup on major


From: ELPA Syncer
Subject: [nongnu] elpa/eglot-inactive-regions badb4e403a 46/66: cleanup on major mode changes
Date: Fri, 6 Dec 2024 06:59:56 -0500 (EST)

branch: elpa/eglot-inactive-regions
commit badb4e403a4f153673703ccdc1069018567be147
Author: Filippo Argiolas <filippo.argiolas@gmail.com>
Commit: Filippo Argiolas <filippo.argiolas@gmail.com>

    cleanup on major mode changes
    
    solves a fontification problem with darken-foreground method when
    switching back and forth between c-mode and c-ts-mode
---
 clangd-inactive-regions.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/clangd-inactive-regions.el b/clangd-inactive-regions.el
index 0826913dd7..b2763b3ac9 100644
--- a/clangd-inactive-regions.el
+++ b/clangd-inactive-regions.el
@@ -264,7 +264,8 @@ Useful to update colors after a face or theme change."
 (defun clangd-inactive-regions--enable ()
   "Helper method to enable inactive regions minor mode."
   (add-function :after (default-value 'font-lock-fontify-region-function)
-                #'clangd-inactive-regions--fontify))
+                #'clangd-inactive-regions--fontify)
+  (add-hook 'change-major-mode-hook #'clangd-inactive-regions-cleanup))
 
 (defun clangd-inactive-regions--disable ()
   "Helper method to enable inactive regions minor mode."
@@ -273,7 +274,8 @@ Useful to update colors after a face or theme change."
   (dolist (buf (buffer-list))
     (clangd-inactive-regions-cleanup)
     (setq clangd-inactive-regions--ranges '())
-    (setq clangd-inactive-regions--active nil)))
+    (setq clangd-inactive-regions--active nil))
+  (remove-hook 'change-major-mode-hook #'clangd-inactive-regions-cleanup))
 
 (cl-defmethod eglot-client-capabilities :around (server)
   (let ((base (cl-call-next-method)))



reply via email to

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