branch: externals/consult-recoll
commit 9ce929510f5d418f71f46d6e7ab351f4a97adad2
Author: jao <j...@gnu.org>
Commit: jao <j...@gnu.org>

    fix: reset index and current for every new search term
---
 consult-recoll.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/consult-recoll.el b/consult-recoll.el
index d3920a0288..c98971fd7c 100644
--- a/consult-recoll.el
+++ b/consult-recoll.el
@@ -99,6 +99,8 @@ Set to nil to use the default 'title (path)' format."
 
 (defun consult-recoll--command (text)
   "Command used to perform queries for TEXT."
+  (setq consult-recoll--current nil)
+  (setq consult-recoll--index 0)
   `("recollq" "-A" "-p" "5" ,@consult-recoll-search-flags ,text))
 
 (defconst consult-recoll--line-rx "^\\(.*?\\)\t\\[\\(.*?\\)\\]\t\\[\\(.*\\)\\]"
@@ -207,8 +209,6 @@ Set to nil to use the default 'title (path)' format."
 (defun consult-recoll--search (&optional initial)
   "Perform an asynchronous recoll search via `consult--read'.
 If given, use INITIAL as the starting point of the query."
-  (setq consult-recoll--current nil)
-  (setq consult-recoll--index 0)
   (consult--read (consult--async-command
                      #'consult-recoll--command
                    (consult--async-filter #'identity)

Reply via email to