diff options
| author | Umar Ahmad <Gleek@users.noreply.github.com> | 2021-12-18 23:34:14 +0530 |
|---|---|---|
| committer | Basil L. Contovounesios <basil@contovou.net> | 2025-04-15 13:15:18 +0200 |
| commit | c9cdd2235c41a504d1e77af573a0c2b6b0ba681f (patch) | |
| tree | c2de926244613c64018a28298f312c35d7eda174 | |
| parent | e33b028ed4b1258a211c87fd5fe801bed25de429 (diff) | |
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
| -rw-r--r-- | ivy.el | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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) |
