Merge pull request #28 from watsoncj/master

Allow passing arbitrary arguments and paths to Rg command, thanks @watsoncj
This commit is contained in:
John Remmen 2018-09-08 19:26:08 -07:00 committed by GitHub
commit ec87af6b69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,7 @@ if !exists('g:rg_window_location')
endif
fun! g:RgVisual() range
call s:RgGrepContext(function('s:RgSearch'), s:RgGetVisualSelection())
call s:RgGrepContext(function('s:RgSearch'), '"' . s:RgGetVisualSelection() . '"')
endfun
fun! s:Rg(txt)
@ -61,7 +61,7 @@ fun! s:RgSearch(txt)
if &smartcase == 1
let l:rgopts = l:rgopts . '-S '
endif
silent! exe 'grep! ' . l:rgopts . '"' . a:txt . '"'
silent! exe 'grep! ' . l:rgopts . a:txt
if len(getqflist())
exe g:rg_window_location 'copen'
redraw!