Skip to content

Commit

Permalink
counsel--async-command-1: Immediately update minibuffer after spawning
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bcc32 committed Nov 21, 2023
1 parent 8c30f4c commit 375a055
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions counsel.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 375a055

Please sign in to comment.