Skip to content

Commit 8d27cd2

Browse files
committed
Allow passing arbitrary arguments and paths to Rg command
- Only wrap the search string in quotes during visual search. As was the behavior prior to 7d01d69. - Restore the ability to use all ripgrep features from command mode: `:Rg --fixed-strings \.Model service/` fixes #25
1 parent f7c1549 commit 8d27cd2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugin/vim-ripgrep.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if !exists('g:rg_window_location')
2525
endif
2626

2727
fun! g:RgVisual() range
28-
call s:RgGrepContext(function('s:RgSearch'), s:RgGetVisualSelection())
28+
call s:RgGrepContext(function('s:RgSearch'), '"' . s:RgGetVisualSelection() . '"')
2929
endfun
3030

3131
fun! s:Rg(txt)
@@ -61,7 +61,7 @@ fun! s:RgSearch(txt)
6161
if &smartcase == 1
6262
let l:rgopts = l:rgopts . '-S '
6363
endif
64-
silent! exe 'grep! ' . l:rgopts . '"' . a:txt . '"'
64+
silent! exe 'grep! ' . l:rgopts . a:txt
6565
if len(getqflist())
6666
exe g:rg_window_location 'copen'
6767
redraw!

0 commit comments

Comments
 (0)