From cf9d03cd58ff0105dda9e444b9fb9f464eb6270d Mon Sep 17 00:00:00 2001 From: JenChieh Date: Wed, 3 Apr 2024 14:51:45 -0700 Subject: [PATCH] fix: Prevent duplicate actions --- sideline-lsp.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sideline-lsp.el b/sideline-lsp.el index 70eaa86..9c1fbf7 100644 --- a/sideline-lsp.el +++ b/sideline-lsp.el @@ -147,7 +147,7 @@ Execute CALLBACK to display candidates in sideline." (or (not kind?) (s-match sideline-lsp-actions-kind-regex kind?))) actions))) - (setq sideline-lsp--ht-code-actions (ht-create)) + (ht-clear sideline-lsp--ht-code-actions) (dolist (action actions) (-let* ((title (->> (lsp:code-action-title action) @@ -162,6 +162,7 @@ Execute CALLBACK to display candidates in sideline." (when (or (not sideline-lsp-ignore-duplicate) (not (member title (ht-keys sideline-lsp--ht-code-actions)))) (ht-set sideline-lsp--ht-code-actions title code-action)))) + (sideline-delete-backend-ovs 'sideline-lsp) (funcall callback (ht-keys sideline-lsp--ht-code-actions))) (provide 'sideline-lsp)