Skip to content

Commit 338771e

Browse files
committed
Escaping Command-line special characters '#', '%' and '|' jremmen#66
jremmen#66
1 parent 2bb2425 commit 338771e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugin/vim-ripgrep.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ 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+
" Escaping Command-line special characters '#', '%' (:h :_%), and '|' (:h :bar)
65+
silent! exe 'grep! ' . l:rgopts . escape(a:txt, "#%|")
6566
if len(getqflist())
6667
exe g:rg_window_location 'copen'
6768
redraw!

0 commit comments

Comments
 (0)