提交 f7358439 编写于 作者: R Rob Lourens

Fix #25234 - unescape slashes in search string

上级 7516e313
......@@ -423,7 +423,8 @@ function getRgArgs(config: IRawSearch): { args: string[], siblingClauses: glob.I
let searchPatternAfterDoubleDashes: string;
if (config.contentPattern.isWordMatch) {
const regexp = strings.createRegExp(config.contentPattern.pattern, config.contentPattern.isRegExp, { wholeWord: config.contentPattern.isWordMatch });
args.push('--regexp', regexp.source);
const regexpStr = regexp.source.replace(/\\\//g, '/'); // RegExp.source arbitrarily returns escaped slashes. Search and destroy.
args.push('--regexp', regexpStr);
} else if (config.contentPattern.isRegExp) {
args.push('--regexp', config.contentPattern.pattern);
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册