From 04abc6907c45e877dbb675dc7dade208b6c91281 Mon Sep 17 00:00:00 2001 From: amix Date: Tue, 27 Dec 2016 11:45:17 -0300 Subject: [PATCH] Improved the escaping when using the silver searcher (Ag) --- vimrcs/basic.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vimrcs/basic.vim b/vimrcs/basic.vim index ce1c38ed..6c1d423c 100644 --- a/vimrcs/basic.vim +++ b/vimrcs/basic.vim @@ -383,11 +383,11 @@ function! VisualSelection(direction, extra_filter) range let l:saved_reg = @" execute "normal! vgvy" - let l:pattern = escape(@", '\\/.*$^~[]') + let l:pattern = escape(@", "\\/.*'$^~[]") let l:pattern = substitute(l:pattern, "\n$", "", "") if a:direction == 'gv' - call CmdLine("Ag \"" . l:pattern . "\" " ) + call CmdLine("Ag '" . l:pattern . "' " ) elseif a:direction == 'replace' call CmdLine("%s" . '/'. l:pattern . '/') endif