From 1936e105cc12858da899a2258ca59caab29fe406 Mon Sep 17 00:00:00 2001 From: lbrayner Date: Thu, 16 Jun 2022 18:21:58 -0300 Subject: [PATCH] Escaping Command-line special characters '#', '%' and '|' --- plugin/vim-ripgrep.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/vim-ripgrep.vim b/plugin/vim-ripgrep.vim index 7188001..16df83b 100644 --- a/plugin/vim-ripgrep.vim +++ b/plugin/vim-ripgrep.vim @@ -61,7 +61,8 @@ fun! s:RgSearch(txt) if &smartcase == 1 let l:rgopts = l:rgopts . '-S ' endif - silent! exe 'grep! ' . l:rgopts . a:txt + " Escaping Command-line special characters '#', '%' (:h :_%), and '|' (:h :bar) + silent! exe 'grep! ' . l:rgopts . escape(a:txt, "#%|") if len(getqflist()) exe g:rg_window_location 'copen' redraw!