mirror of
https://github.com/jremmen/vim-ripgrep.git
synced 2025-12-26 19:45:29 +08:00
Respect vim's smartcase and ignorecase options.
Resolve's https://github.com/jremmen/vim-ripgrep/issues/5
This commit is contained in:
parent
7d01d6976b
commit
0df3ac2c3e
1 changed files with 8 additions and 1 deletions
|
|
@ -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!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue