-
Notifications
You must be signed in to change notification settings - Fork 86
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
Plugin hangs when Cmd files
in executed from $HOME CWD
#75
Comments
Yes, I'm seeing this too. Unfortunately it's hard to resolve, although everything in vim-clap can be async now, for it is essentially a problem that how to keep reponsive when dealing with the CPU-intensive jobs. There are more than 1 milion files in the home directory on my machine. Try using fd or rg to search some file under the home directory from the terminal, you'll see the CPU usage is almost 100%, especially when the query string is short. Use fzf.vim instead if you do often search under the home directory. I don't have a solution for now. Let me know if anyone knows how to keep it responsive when the CPU usage is utterly high. |
@liuchengxu Thank you. |
With PR #70 , I don't see this issue. |
I don't know what kind of algorithm clap uses, LeaderF doesn't wait until all the files indexing is finished, it uses one thread to index the files and uses another thread to do fuzzy matching and display the results. |
The strategy of clap is trivial. What clap actually does is to start a fd/rg job in the background to do the searching task, whenever the output callback gets some results, display or cache them. And I think it because the out_cb of vim is linewise that you will feel less responsive in this situation compared to neovim. I guess the thread model used in LeaderF is not appliable to clap as it's in pure vimscript :(. I have no idea vimscript could do the same thing. |
Bad luck, vimscript does not have the concept of thread. |
Yes, I am using neovim. But one can come out by pressing |
@liuchengxu Maybe you need to |
Can you elaborate? @Yggdroot I don't see it on my side. |
I did not mean Clap has such a situation, just a hint. |
Thanks for the heads up :(. Will do when neccessary. |
Closing this in favor of #140. |
If
Clap files
or similar command related to searching is executed with$HOME
or a folder with large number of files/folders as current working directory, command hangs without a way out. Only way to recover is killing vim(I tested using neovim).Is there a way out in this situation?
The text was updated successfully, but these errors were encountered: