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

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

[nongnu] elpa/eglot-inactive-regions 4b698aaeb8 42/66: always enable ina


From: ELPA Syncer
Subject: [nongnu] elpa/eglot-inactive-regions 4b698aaeb8 42/66: always enable inactiveRegions caps
Date: Fri, 6 Dec 2024 06:59:56 -0500 (EST)

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

    always enable inactiveRegions caps
    
    Previous logic tried to only enable inactiveRegions notification when
    minor mode was enabled but it wasn't working as expected. Always
    enable notifications and ignore them if minor mode is disabled.
---
 clangd-inactive-regions.el | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/clangd-inactive-regions.el b/clangd-inactive-regions.el
index c87853fe75..612d0188af 100644
--- a/clangd-inactive-regions.el
+++ b/clangd-inactive-regions.el
@@ -261,16 +261,7 @@ Useful to update colors after a face or theme change."
       (add-function :after (default-value 'font-lock-fontify-region-function)
                     #'clangd-inactive-regions--fontify)
     (add-function :after (local 'font-lock-fontify-region-function)
-                  #'clangd-inactive-regions--fontify))
-
-  (cl-defmethod eglot-client-capabilities :around (server)
-    (let ((base (cl-call-next-method)))
-      (when (cl-find "clangd" (process-command (jsonrpc--process server))
-                     :test #'string-match)
-        (setf (cl-getf (cl-getf base :textDocument)
-                       :inactiveRegionsCapabilities)
-              '(:inactiveRegions t)))
-      base)))
+                  #'clangd-inactive-regions--fontify)))
 
 (defun clangd-inactive-regions--enabled-anywhere-p ()
   "Check if our mode is enabled in any classic C mode buffers."
@@ -293,9 +284,16 @@ Useful to update colors after a face or theme change."
                          #'clangd-inactive-regions--fontify))
     (remove-function (local 'font-lock-fontify-region-function)
                      #'clangd-inactive-regions--fontify))
-  (clangd-inactive-regions-cleanup)
-  (cl-defmethod eglot-client-capabilities :around (server)
-    (cl-call-next-method server)))
+  (clangd-inactive-regions-cleanup))
+
+(cl-defmethod eglot-client-capabilities :around (server)
+  (let ((base (cl-call-next-method)))
+    (when (cl-find "clangd" (process-command (jsonrpc--process server))
+                   :test #'string-match)
+      (setf (cl-getf (cl-getf base :textDocument)
+                     :inactiveRegionsCapabilities)
+            '(:inactiveRegions t)))
+    base))
 
 (cl-defmethod eglot-handle-notification
   (_server (_method (eql textDocument/inactiveRegions))



reply via email to

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