From 858df3dfa080fa763865be9de4abd6972241f95f Mon Sep 17 00:00:00 2001 From: Mitchel Humpherys Date: Mon, 8 Nov 2021 10:38:53 -0800 Subject: [PATCH] init.el: swiper: Avoid delay when moving through results Fixes: https://github.com/abo-abo/swiper/issues/1218#issuecomment-955026714 --- init.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/init.el b/init.el index 8ffc3dd..279c2a7 100644 --- a/init.el +++ b/init.el @@ -1034,6 +1034,15 @@ alteration." :init (use-package counsel) (use-package swiper) + ;; advice to prevent dynamic exhibit delay for C-n/C-p + ;; https://github.com/abo-abo/swiper/issues/1218#issuecomment-962516670 + (defvar +ivy--queue-last-input nil) + (defun +ivy-queue-exhibit-a(f &rest args) + (if (equal +ivy--queue-last-input (ivy--input)) + (ivy--exhibit) + (apply f args)) + (setq +ivy--queue-last-input (ivy--input))) + (advice-add 'ivy--queue-exhibit :around #'+ivy-queue-exhibit-a) :config (setq ivy-use-virtual-buffers t) (setq enable-recursive-minibuffers t))