-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Don't match filepath in grep2 #385
Conversation
Just like what I have mentioned in https://github.com/liuchengxu/vim-clap/blob/master/CHANGELOG.md#added, that's expected at the moment, for |
@vn-ki Can you show me the link of the repo used in your above picture? |
https://github.com/vn-ki/harsark.rs I find fuzzy really unsuitable for text searching. |
@vn-ki You just spot a bug of clap! This patch should help at present. diff --git a/autoload/clap/filter/async/dyn.vim b/autoload/clap/filter/async/dyn.vim
index 66b043b..6e3e732 100644
--- a/autoload/clap/filter/async/dyn.vim
+++ b/autoload/clap/filter/async/dyn.vim
@@ -30,7 +30,7 @@ function! clap#filter#async#dyn#from_tempfile(tempfile) abort
else
let enable_icon_opt = ''
endif
- let filter_cmd = printf('%s --number 100 --winwidth %d filter "%s" --input "%s"',
+ let filter_cmd = printf('%s --number 30 --winwidth %d filter "%s" --input "%s"',
\ enable_icon_opt,
\ winwidth(g:clap.display.winid),
\ g:clap.input.get(),
@@ -41,7 +41,7 @@ endfunction
function! clap#filter#async#dyn#start_grep() abort
let s:last_query = g:clap.input.get()
- let grep_cmd = printf('%s --number 100 --winwidth %d grep "" "%s" --cmd-dir "%s"',
+ let grep_cmd = printf('%s --number 30 --winwidth %d grep "" "%s" --cmd-dir "%s"',
\ g:clap_enable_icon ? '--enable-icon' : '',
\ winwidth(g:clap.display.winid),
\ g:clap.input.get(),
@@ -53,7 +53,7 @@ endfunction
function! clap#filter#async#dyn#grep_from_cache(tempfile) abort
let s:last_query = g:clap.input.get()
- let grep_cmd = printf('%s %s --number 100 --winwidth %d grep "" "%s" --input "%s"',
+ let grep_cmd = printf('%s %s --number 30 --winwidth %d grep "" "%s" --input "%s"',
\ g:clap_enable_icon ? '--enable-icon' : '',
\ has_key(g:clap.context, 'no-cache') ? '--no-cache' : '',
\ winwidth(g:clap.display.winid), The problem is this number
To make clap faster, I force to only take top 30 items in the results. People with a big screen might think 30 rows are not enough, but we should know that the performance can be worse when we want to show more top items. Maybe we could allow it to have a few limited options, e.g., [30, 40, 50]. |
@vn-ki The issue you found should be fixed on mater now. The future improvements could be to add new filter approach aside from the current fuzzy filter ways, e.g, plain string match. https://github.com/junegunn/fzf#search-syntax is also nice to have, but it might need quite a work. |
Fix #383 (comment)
Also fix some errors found in maple.