New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
possible new feature: append candidates periodically #340
Comments
I second this proposal. |
+1 for the proposal |
Please check. The candidate list should refresh every 0.5s and display |
Wonderful work @abo-abo! Works like a charm. |
Thanks @abo-abo I haven't played with it too much, but it's not as smooth as I would have hoped on my computer. My first thought for an alternative was something like this. (defvar counsel--async-lines 0)
(defvar counsel--async-line-threshold 1000)
(defun counsel--async-filter (process str)
"Receive from PROCESS the output STR."
(when (< counsel--async-lines counsel--async-line-threshold)
(with-current-buffer (process-buffer process)
(insert str)
(setq counsel--async-lines
(count-matches "\n" (point-min) (point-max)))
(when (< counsel--async-lines counsel--async-line-threshold)
(goto-char (point-min))
(setq ivy--all-candidates
(split-string (buffer-string) "\n" t))))
(let ((ivy--prompt (format "%d++ ag:" counsel--async-lines)))
(ivy--insert-minibuffer
(ivy--format ivy--all-candidates)))))
I know I need to do the paperwork now. |
Using
counsel-ag
, if I type a string that's pretty common (~5k-10k candidates maybe) I see the collected notice at the bottom for a few seconds and then the minibuffer fills with candidates when the process is done. Obviously, I need to refine my search. I know that I need to refine it once that counter starts getting large, but I think it would be helpful to see the types of matches I'm getting right away.So what I was thinking is what if you could configure
ivy-read
to collect all of the candidates but to start showing them as soon as you reach some number (I don't know 500 or so). That way you get visual feedback right away showing all of the bad matches you're getting and you can start thinking about how you want to refine the search immediately.This question is inspired by how helm-ag works. Somehow helm-ag shows matches immediately, but keeps collecting remaining ones in the background.
The text was updated successfully, but these errors were encountered: