mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-08 05:39:13 +00:00
Do not run incremental search when query is empty
This commit is contained in:
@@ -208,12 +208,15 @@ C-x i | images
|
|||||||
(khoj-buffer-name (get-buffer-create khoj--buffer-name))
|
(khoj-buffer-name (get-buffer-create khoj--buffer-name))
|
||||||
(query (minibuffer-contents-no-properties))
|
(query (minibuffer-contents-no-properties))
|
||||||
(query-url (khoj--construct-api-query query khoj--search-type rerank-str)))
|
(query-url (khoj--construct-api-query query khoj--search-type rerank-str)))
|
||||||
;; Query khoj API only when user in khoj minibuffer.
|
;; Query khoj API only when user in khoj minibuffer and non-empty query
|
||||||
;; Prevents querying during recursive edits or with contents of other buffers user may jump to
|
;; Prevents querying if
|
||||||
(when (and (active-minibuffer-window) (equal (current-buffer) khoj--minibuffer-window))
|
;; 1. user hasn't started typing query
|
||||||
|
;; 2. during recursive edits
|
||||||
|
;; 3. with contents of other buffers user may jump to
|
||||||
|
(when (and (not (equal query "")) (active-minibuffer-window) (equal (current-buffer) khoj--minibuffer-window))
|
||||||
(progn
|
(progn
|
||||||
(when rerank
|
(when rerank
|
||||||
(message "[Khoj]: Rerank Results"))
|
(message "Khoj: Rerank Results"))
|
||||||
(khoj--query-api-and-render-results
|
(khoj--query-api-and-render-results
|
||||||
query
|
query
|
||||||
khoj--search-type
|
khoj--search-type
|
||||||
|
|||||||
Reference in New Issue
Block a user