From 375a055ab19345d2839d63f8515755d8d6f1c00d Mon Sep 17 00:00:00 2001 From: "Aaron L. Zeng" Date: Tue, 21 Nov 2023 15:22:20 -0500 Subject: [PATCH] counsel--async-command-1: Immediately update minibuffer after spawning This fixes an issue in counsel-rg and related commands where, if the user quickly types some string that does not have any grep results, and the search takes a long time, then the candidates list will say "1 more chars" while ripgrep is already running and won't be updated until ripgrep exits. --- counsel.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/counsel.el b/counsel.el index 007db01a..834b92cd 100644 --- a/counsel.el +++ b/counsel.el @@ -241,6 +241,9 @@ respectively." (setq counsel--async-start counsel--async-time) (set-process-sentinel proc (or sentinel #'counsel--async-sentinel)) (set-process-filter proc (or filter #'counsel--async-filter)) + ;; immediately update the display + (let ((counsel-async-filter-update-time 0)) + (funcall (process-filter proc) proc "")) proc)) (defcustom counsel-async-command-delay 0