-
Notifications
You must be signed in to change notification settings - Fork 58
Always No results with ripgrep 13.0 #244
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
Comments
Confirmed. It hangs with/at Using 9b62e6b also for Linux fixes it, i.e. use e.g. (which also adds let g:grepper = extend(get(g:, 'grepper', {}), {
…
\ 'rg': {'grepprg': 'rg -H --no-heading --vimgrep --sort-files $* .'},
\ }) |
Note that using In BurntSushi/ripgrep#1892 (comment) @kevinhwang91 mentioned to use |
It seems that this change fixes the problem:
|
Yeah. |
Actually, using diff --git a/plugin/grepper.vim b/plugin/grepper.vim
index 73e4e36..114a54e 100644
--- a/plugin/grepper.vim
+++ b/plugin/grepper.vim
@@ -155,6 +155,7 @@ function! s:on_stdout_nvim(_job_id, data, _event) dict abort
" Second-last item is the last complete line in a:data.
let acc_line = self.stdoutbuf . a:data[0]
let lcandidates = (empty(acc_line) ? [] : [acc_line]) + a:data[1:-2]
+ let lcandidates = map(lcandidates, {key, val -> trim(val)})
let self.stdoutbuf = ''
endif
" Last item in a:data is an incomplete line (or empty), append to buffer
@@ -935,6 +936,7 @@ function! s:run(flags)
\ 'on_stdout': function('s:on_stdout_nvim'),
\ 'on_stderr': function('s:on_stdout_nvim'),
\ 'on_exit': function('s:on_exit'),
+ \ 'pty': 1,
\ }
if !a:flags.stop
let opts.stdout_buffered = 1
|
@insidewhy I think the best fix for now would be #244 (comment) from @datanoise. Have you tried it? As for me, I am holding back the upgrade of ripgrep due to this for now. I've added some comment/question about an explicit switch to the ripgrep issue: BurntSushi/ripgrep#1892 (comment) |
Am I correct to assume that Neovim PR-14812 will fix this issue? No change needed with this plugin? |
@bluz71 I just tried neovim HEAD-8baf7bc (after Neovim PR-14812) with vim-grepper HEAD-b80004c and the issue persists. Anyone else? |
I got tired of waiting for a fix, in the end I decided to stop using vim-grepper and just go native (no plugin at all). Native works just as well for me as vim-grepper ever did. My configuration: set grepprg=rg\ --vimgrep\ --smart-case
set grepformat=%f:%l:%c:%m,%f:%l:%m
nnoremap <Leader>/ :silent grep<Space>
nnoremap gs :silent grep <C-r><C-w><CR>:copen<CR>
xnoremap gs "sy:silent grep <C-r>s<CR>:copen<CR>
For greater control I use fzf.vim Somehow it feels better to not need to use a plugin at all, my startup is also 2ms faster (haha). Cheers. |
@bluz71 I have a similar setup for fzf.vim but I still use vim-grepper when I want results in quickfix though. There are a few other features unique to vim-grepper keeping me like GrepperOperator, highlight, and async. |
My mappings do populate the quickfix list. I myself never used GrepperOperator, highlight nor async. Other folks may need those, I didn't. I could no longer stand waiting for a fix, either on the Neovim side nor here. It could well be that in two months nothing has changed. |
@bluz71 Thanks for posting this! I'm glad to finally have grep via rg working again. I have something to ask you about: for some reason this approach seems to be very slow, there appears to be slowdown while populating the quickfix. Do you see this too? I apologize if some users feel this is too off-topic, I'd be happy to take it elsewhere. When comparing the speed of the search mappings to the exact same search ran via p.s. I hacked together a user command that loads the results into quickfix and then also highlights the search string: command! -nargs=+ QGrep execute 'silent grep! "<args>"' | copen | call feedkeys("/<args><CR>")
nnoremap gs/ :QGrep<Space> |
I just checked out the rails repository, which is about 300,000 lines of Ruby. Decently big, not the biggest, but bigger than your usual respository. I did a ripgrep search (via my Neovim mapping) for Machine, a bog-standard Linux desktop using an SSD. |
@bluz71 Thanks for your response, that is helpful to know! I'm seeing something very similar on rails/rails, the codebase I was working on is about 10x larger than rails so the problem might be more apparent. When I run rg directly like this But when I set the same rg command to be the grepprg and then run I think this is off-topic so I may not post here about it anymore, but if anyone is interested please feel free to let me know! |
How does Grepper perform by comparison on very large repo? |
I can reproduce your issue with the Linux Kernal repo. About 16 seconds to search for Interesting I also used fzf.vim's Hence I think populating the quickfix list with many many items is the bottleneck. That's an upstream issue. Luckily I never deal with superhuge repos. |
@bluz71 Thanks for sharing the update! It's good to know it's not specific to my system. I was not able to accurately compare with vim-grepper due to this issue with ripgrep v13 (on macos I have not been able to find a way to downgrade ripgrep). It must be quickfix related then. I was able to work-around the issue by finding a way to |
Version 13.0 isn't working well with vim-grepper: mhinz/vim-grepper#244
You can try compare them using other search tool like
Just download the binary of an older release and put it somewhere in |
What was the syntax for you used to achieve that inside Vim using grepprg? |
@klas-genestack Thanks! Good points. If I end up comparing performance I will let you know. @bluz71 I could not figure out how to do that purely in vim sadly (if you find it please let me know!), so I wrote a shell script to wrap rg, I use it like this: A #!/bin/bash
rg --vimgrep --hidden --follow --max-columns=1000 --color=never --case-sensitive "$@" | head -n 1000 | sort And in .vimrc: if executable('vimgrep')
set grepprg=vimgrep
elseif executable('rg')
set grepprg=rg\ --vimgrep\ --hidden\ --follow\ --max-columns=1000\ --case-sensitive
endif
set grepformat=%f:%l:%c:%m,%f:%l:%m
command! -nargs=+ -complete=file QGrep execute 'silent grep! <args>' | copen
nnoremap gs/ :QGrep "" .<Left><Left><Left> |
I don't mean to be rude, but there's a lot of off-topic discussion in this issue now. @blueyed already posted a trivial fix (#244 (comment)), so the discussion around how to replace vim-grepper isn't really warranted. It seems that vim-grepper should merge a fix (though it probably needs tweaked to support Windows) given that the Neovim PR didn't fix this and it doesn't seem that ripgrep will change. @blueyed thoughts? |
neovim/neovim#14812 by itself is not fixing the issue since the new option it introduces defaults to the original value. I've sent a PR that I've verified actually fixes it here #250. |
After upgrade to Ripgrep 13.0 constantly shows "No results". Visually output or behavior of ripgrep hasn't changed.
The text was updated successfully, but these errors were encountered: