branch: externals/ivy
commit c9cdd2235c41a504d1e77af573a0c2b6b0ba681f
Author: Umar Ahmad <[email protected]>
Commit: Basil L. Contovounesios <[email protected]>
Only enable dynamic exhibit delay while typing
* ivy.el (ivy--queue-last-input): New variable holding last input.
(ivy--queue-exhibit): Debounce by only starting timer if ivy--input
has changed (#2941). Otherwise, even moving to another candidate
with unchanged input incurs a delay.
Fixes #1218.
Copyright-paperwork-exempt: yes
---
ivy.el | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/ivy.el b/ivy.el
index 063c9eee59..22e8012564 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3412,6 +3412,7 @@ Otherwise, ~/ will move home."
"Delay in ms before dynamic collections are refreshed"
:type 'integer)
+(defvar ivy--queue-last-input nil)
(defvar ivy--exhibit-timer nil)
(defun ivy--queue-exhibit ()
@@ -3419,7 +3420,8 @@ Otherwise, ~/ will move home."
dynamic collections.
Should be run via minibuffer `post-command-hook'."
(if (and (> ivy-dynamic-exhibit-delay-ms 0)
- (ivy-state-dynamic-collection ivy-last))
+ (ivy-state-dynamic-collection ivy-last)
+ (not (equal ivy--queue-last-input (ivy--input))))
(progn
(when ivy--exhibit-timer (cancel-timer ivy--exhibit-timer))
(setq ivy--exhibit-timer
@@ -3427,7 +3429,8 @@ Should be run via minibuffer `post-command-hook'."
(/ ivy-dynamic-exhibit-delay-ms 1000.0)
nil
'ivy--exhibit)))
- (ivy--exhibit)))
+ (ivy--exhibit))
+ (setq ivy--queue-last-input (ivy--input)))
(defalias 'ivy--file-local-name
(if (fboundp 'file-local-name)