From 4e4ea285452c0ae3913a2dc162ac531c2661ef17 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 9 Feb 2017 16:39:52 +0100 Subject: [PATCH] Fix #20311 --- src/vs/workbench/parts/search/common/searchModel.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vs/workbench/parts/search/common/searchModel.ts b/src/vs/workbench/parts/search/common/searchModel.ts index d68b58e73bc..02bd2201214 100644 --- a/src/vs/workbench/parts/search/common/searchModel.ts +++ b/src/vs/workbench/parts/search/common/searchModel.ts @@ -71,10 +71,17 @@ export class Match { let searchModel = this.parent().parent().searchModel; let matchString = this.getMatchString(); let replaceString = searchModel.replacePattern.getReplaceString(matchString); + // If match string is not matching then regex pattern has a lookahead expression if (replaceString === null) { replaceString = searchModel.replacePattern.getReplaceString(matchString + this._lineText.substring(this._range.endColumn - 1)); } + + // Match string is still not matching. Could be unsupported matches (multi-line). + if (replaceString === null) { + replaceString = searchModel.replacePattern.pattern; + } + return replaceString; }