branch: externals/consult
commit af829f61fbb180914deab856b82f90cd9d4b8ca2
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>

    consult--dynamic-compute: Avoid unnecessary recomputation
---
 consult.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/consult.el b/consult.el
index a05c9d8a44..b12257da2a 100644
--- a/consult.el
+++ b/consult.el
@@ -2403,12 +2403,13 @@ FUN computes the candidates given the input."
                (funcall async 'indicator state))))
          (funcall async nil))
         ((pred stringp)
-         (unless (equal action current)
-           ;; Do not perform the computation immediately, only when the
-           ;; candidates are requested.
+         ;; Do not perform the computation immediately, only when the
+         ;; candidates are requested.
+         (if (equal action current)
+             (setq request nil)
            (setq request action)
            (funcall async 'refresh)))
-        (_ (funcall async action))))))
+        (_ (funcall async action)))))
 
 (defun consult--dynamic-collection (fun &optional debounce min-input)
   "Dynamic collection with input splitting.

Reply via email to