Helm: Emacs helm grep flickering

Created on 24 Oct 2018  路  5Comments  路  Source: emacs-helm/helm

Expected behavior

No flickering of the results buffer while typing query, like with counsel-rg, see: https://asciinema.org/a/yidh8fXFxlgbHO7uxSOX7EFkj

Actual behavior (from emacs-helm.sh if possible, see note at the bottom)

Typing anything in the query (e.g. just spaces or deleting/readding last character) causes the entire results buffer to flicker even though the results themselves do not change (the highlighting in it might):
https://asciinema.org/a/vSHfMCKHqAZnQ0Y5Jtu9Zrtk4

Steps to reproduce (recipe)

./emacs-helm.sh -nw ~/linux
search for system and then type spaces (or delete/readd m character). See above screencast for more details.

Note: there is no flickering when using helm-M-x.

Also reproduces with: doom-emacs, spacemacs.

Backtraces if any (M-x toggle-debug-on-error)

Describe versions of Helm, Emacs, operating system, etc.

helm-20181005.1844
GNU Emacs 26.1
Ubuntu 18.10

Also reproduces on:
helm v3.0-12-g46157453
GNU Emacs 25.2.2
Ubuntu 18.04

Are you using emacs-helm.sh to reproduce this bug (yes/no):

yes

Most helpful comment

Now you can use helm-grep-input-idle-delay which affect grep, git-grep and grep-ag.
Default is 0.6.

All 5 comments

T枚r枚k Edwin notifications@github.com writes:

Expected behavior

No flickering of the results buffer while typing query,

This because Helm grep and its variants (AG, RG etc...) are asynchronous
while in the other implementations they are not, e.g. helm-ag and
probably the one you mentioned (counsel).
IOW when you type something in Helm pattern Helm launch a new search
with the backend e.g. RG on the directory you mentioned while helm-ag
for example search in the results already found by the backend (the
directory is not searched again with the new pattern).
If you want to do a complex regexp search with Helm grep and you want to
avoid Helm launch a new search at each time you modify pattern, use C-!,
enter your complex regexp and when ready hit again C-! (See in your
mode-line it is mentioned).

--
Thierry

Thanks for the explanation, I do like the "live" update, but want to avoid flickering while still typing.
I found that if I set (setq helm-input-idle-delay 0.2) then it does not flicker so much, and still updates "fast enough". Counsel is asynchronouos too, but by default only updates every 0.5s.

Perhaps the FAQ or Wiki could mention this as a solution to flickering, and then this issue can be closed.

T枚r枚k Edwin notifications@github.com writes:

Thanks for the explanation, I do like the "live" update, but want to avoid flickering while still typing.
I found that if I set (setq helm-input-idle-delay 0.2) then it does
not flicker so much, and still updates "fast enough".

Yes, but this affect also sync sources and it is not what you want.
What can be done is having a new var for idle-delay in async sources,
but when using multiple sources (e.g. helm-for-files) this will not work.

We have no flickering in update with sync sources because rendering is
done only when candidates have been computed, it is much more complex to
achieve the same with a process-filter (update is arriving by chunks of text).

Counsel is asynchronouos too, but by default only updates every 0.5s.

IIRC counsel (I guess it is another name for ivy) is supporting only one
source whereas helm support sync sources and async sources in same helm session.

--
Thierry

Now you can use helm-grep-input-idle-delay which affect grep, git-grep and grep-ag.
Default is 0.6.

Was this page helpful?
0 / 5 - 0 ratings