From 8882b9b289e28b982f365163d6eaf0fe87b3303d Mon Sep 17 00:00:00 2001 From: Konfekt Date: Fri, 27 Aug 2021 09:24:07 +0200 Subject: [PATCH] unescape braces if necessary --- plugin/grepper.vim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugin/grepper.vim b/plugin/grepper.vim index 01dfa51..6fe8c27 100644 --- a/plugin/grepper.vim +++ b/plugin/grepper.vim @@ -547,6 +547,14 @@ function! s:query2vimregexp(flags) abort endif let vim_query = '\V'. vim_query else + " if tool escapes { and }, then unescape them + let tool = s:get_current_tool(a:flags) + if match(tool.escape, '{') != -1 + let vim_query = substitute(vim_query, '\\{', '{', 'g') + endif + if match(tool.escape, '}') != -1 + let vim_query = substitute(vim_query, '\\}', '}', 'g') + endif " \bfoo\b -> \ Assume only one pair. let vim_query = substitute(vim_query, '\v\\b(.{-})\\b', '\\<\1\\>', '') " *? -> \{-}