Skip to content

Commit 12c5daa

Browse files
committed
bdx: Reduce flicker when the list is refreshed as user is typing
* bdx.el (bdx--ivy-collection-function): Only set `bdx--prev-candidates' when we have some existing candidates.
1 parent 4b47c07 commit 12c5daa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bdx.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ as a property of the string."
254254
(defun bdx--ivy-collection-function (string &rest _args)
255255
"Collect candidates for query STRING.
256256
This should be used as COLLECTION for `ivy-read'."
257-
(setq bdx--prev-candidates bdx--all-candidates)
257+
(when bdx--all-candidates
258+
(setq bdx--prev-candidates bdx--all-candidates))
258259
(setq bdx--all-candidates nil)
259260
(setq bdx--outdated-files nil)
260261
(setq bdx--sources-needing-recompilation nil)
@@ -317,7 +318,8 @@ This should be used as COLLECTION for `ivy-read'."
317318
:done-callback
318319
(lambda ()
319320
(when (eq (minibuffer-depth) depth)
320-
(ivy-update-candidates bdx--all-candidates)))
321+
(ivy-update-candidates bdx--all-candidates)
322+
(setq bdx--prev-candidates bdx--all-candidates)))
321323
:error-callback
322324
(lambda (err-string) (setq bdx--last-error err-string))))))))
323325

0 commit comments

Comments
 (0)