Skip to content

Commit 0debbd1

Browse files
committed
Make counsel-async filter update time configurable
1 parent 9b071a8 commit 0debbd1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

counsel.el

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,21 @@ EVENT is a string describing the change."
195195
(setq ivy--old-cands ivy--all-candidates)
196196
(ivy--exhibit)))))
197197

198+
(defcustom counsel-async-filter-update-time 500000
199+
"The amount of time in microseconds to wait until updating
200+
`counsel--async-filter'."
201+
:type 'integer
202+
:group 'ivy)
203+
198204
(defun counsel--async-filter (process str)
199205
"Receive from PROCESS the output STR.
200206
Update the minibuffer with the amount of lines collected every
201-
0.5 seconds since the last update."
207+
`counsel-async-filter-update-time' microseconds since the last update."
202208
(with-current-buffer (process-buffer process)
203209
(insert str))
204210
(let (size)
205211
(when (time-less-p
206-
;; 0.5s
207-
'(0 0 500000 0)
212+
`(0 0 ,counsel-async-filter-update-time 0)
208213
(time-since counsel--async-time))
209214
(with-current-buffer (process-buffer process)
210215
(goto-char (point-min))

0 commit comments

Comments
 (0)