-
Notifications
You must be signed in to change notification settings - Fork 85
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
g:clap_popup_input_delay = 0 still have delay time #989
Comments
I'm unsure what kind of delay you are referring to, it works fine on my side. Does it work before and happens lately or it's your first time to use vim-clap? Also, please post the info of To have a better understanding of what happened, create a config.toml according to your system https://github.com/liuchengxu/vim-clap#config-file, add the log option:
Open vim and run
If the backend is fine, change |
This "delay" is "g:clap_popup_input_delay", and it should be a "frontend" delay. The searching should be start "immediately" after keying 1 char when set this option to 0, but it not, the searching start after about 0.1 second when I stop keying, does it meet expectation?(searching is fast) |
No, if it's 0, the query should be sent to the backend immediately. vim-clap/autoload/clap/popup/move_manager.vim Line 258 in 710c0dc
BTW, how do you know it's a delay of 0.1s right after typing a char? |
btw above situation does not happen on another plugin https://github.com/Yggdroot/LeaderF |
I see, there is a debounce of 200ms by default
Try this patch and see if it helps. diff --git a/autoload/clap/client.vim b/autoload/clap/client.vim
index adec0fb..a322d28 100644
--- a/autoload/clap/client.vim
+++ b/autoload/clap/client.vim
@@ -88,7 +88,7 @@ function! clap#client#notify_on_init(...) abort
\ 'display': { 'bufnr': g:clap.display.bufnr, 'winid': g:clap.display.winid },
\ 'cwd': clap#rooter#working_dir(),
\ 'icon': g:clap_enable_icon ? get(g:clap.provider._(), 'icon', 'Null') : 'Null',
- \ 'debounce': get(g:clap.provider._(), 'debounce', v:true),
+ \ 'debounce': get(g:clap.provider._(), 'debounce', v:false),
\ 'no_cache': has_key(g:clap.context, 'no-cache') ? v:true : v:false,
\ 'start_buffer_path': expand('#'.g:clap.start.bufnr.':p'),
\ } If this is the reason, we can make it configurable so that people can decide on their own. |
It solve issue, thanks! Feel alot faster to set debounce to false |
In #993, you can configure the debounce using the config file https://github.com/liuchengxu/vim-clap#config-file. Note that the debounce is pretty beneficial when you work with an enormous amount of results (dozens of millions), but it's indeed more responsive when the data reset is not huge without the debounce. [provider.debounce]
# Change the debounce delay to 150ms for all providers, the default is 200ms
"*" = 150
# Change the debounce delay to 0ms for files provider specifically.
"files" = 0 |
Instructions: Replace the template text and remove irrelevant text (including this line)
Warning: if you don't fill this issue template and provide the reproducible steps the issue could be closed directly.
Environment (please complete the following information):
To Reproduce
let g:clap_popup_input_delay = 0 in .vimrc
:Clap files
type somethings in Clap ui and it's easy to feel there is still have delay time
The text was updated successfully, but these errors were encountered: