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

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

[nongnu] elpa/eglot-inactive-regions 4f5ab3203c 17/66: No need to copy-t


From: ELPA Syncer
Subject: [nongnu] elpa/eglot-inactive-regions 4f5ab3203c 17/66: No need to copy-tree ranges
Date: Fri, 6 Dec 2024 06:59:52 -0500 (EST)

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

    No need to copy-tree ranges
    
    Stale code from an old revision where I was deleting ranges before
    iterating and needed to iterate on a copy
---
 clangd-inactive-regions.el | 43 ++++++++++++++++++++-----------------------
 1 file changed, 20 insertions(+), 23 deletions(-)

diff --git a/clangd-inactive-regions.el b/clangd-inactive-regions.el
index 9e1eae169a..ede62702ae 100644
--- a/clangd-inactive-regions.el
+++ b/clangd-inactive-regions.el
@@ -207,29 +207,26 @@ foreground colors, if the face doesn't exist yet create 
it."
   (clangd-inactive-regions-cleanup)
   (when (string= clangd-inactive-regions-method "shade-background")
     (set-face-background 'clangd-inactive-regions-shade-face
-     (clangd-inactive-regions--color-blend
-      (face-foreground 'default)
-      (face-background 'default)
-      clangd-inactive-regions-shading)))
-  (let ((ranges (copy-tree clangd-inactive-regions--ranges)))
-    (dolist (range ranges)
-      (let ((beg (car range))
-            (end (cdr range)))
-        (cond
-         ((string= clangd-inactive-regions-method "darken-foreground")
-          (with-silent-modifications
-            (put-text-property beg end 'clangd-inactive-region t))
-          (font-lock-flush beg end))
-         ((string= clangd-inactive-regions-method "shadow")
-          (let ((ov (make-overlay beg end)))
-            (overlay-put ov 'face 'clangd-inactive-regions-shadow-face)
-            (push ov clangd-inactive-regions--overlays)))
-         ((string= clangd-inactive-regions-method "shade-background")
-          (let ((ov (make-overlay beg (1+ end))))
-            (overlay-put ov 'face 'clangd-inactive-regions-shade-face)
-            (push ov clangd-inactive-regions--overlays)))
-         )
-        ))))
+                         (clangd-inactive-regions--color-blend
+                          (face-foreground 'default)
+                          (face-background 'default)
+                          clangd-inactive-regions-shading)))
+  (dolist (range clangd-inactive-regions--ranges)
+    (let ((beg (car range))
+          (end (cdr range)))
+      (cond
+       ((string= clangd-inactive-regions-method "darken-foreground")
+        (with-silent-modifications
+          (put-text-property beg end 'clangd-inactive-region t))
+        (font-lock-flush beg end))
+       ((string= clangd-inactive-regions-method "shadow")
+        (let ((ov (make-overlay beg end)))
+          (overlay-put ov 'face 'clangd-inactive-regions-shadow-face)
+          (push ov clangd-inactive-regions--overlays)))
+       ((string= clangd-inactive-regions-method "shade-background")
+        (let ((ov (make-overlay beg (1+ end))))
+          (overlay-put ov 'face 'clangd-inactive-regions-shade-face)
+          (push ov clangd-inactive-regions--overlays)))))))
 
 
 (cl-defmethod eglot-client-capabilities :around (server)



reply via email to

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