Respect vim's smartcase and ignorecase options.

Resolve's https://github.com/jremmen/vim-ripgrep/issues/5
This commit is contained in:
= 2018-03-20 23:53:34 -07:00
parent 7d01d6976b
commit 0df3ac2c3e

View file

@ -54,7 +54,14 @@ fun! s:RgSearchTerm(txt)
endfun
fun! s:RgSearch(txt)
silent! exe 'grep! ' . '"' . a:txt . '"'
let l:rgopts = ' '
if &ignorecase == 1
let l:rgopts = l:rgopts . '-i '
endif
if &smartcase == 1
let l:rgopts = l:rgopts . '-S '
endif
silent! exe 'grep! ' . l:rgopts . '"' . a:txt . '"'
if len(getqflist())
exe g:rg_window_location 'copen'
redraw!