Skip to content

Commit

Permalink
Merge pull request #2857 from kevintighe/substitute-confirm
Browse files Browse the repository at this point in the history
fixed buggy interactive substitute replacements
  • Loading branch information
xconverge authored Jul 19, 2018
2 parents 94fcec4 + 733eede commit 7054ea0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cmd_line/commands/substitute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ export class SubstituteCommand extends node.CommandBase {
(await this.confirmReplacement(regex.source, line, vimState, match, matchPos))
) {
newContent = newContent.replace(nonGlobalRegex, this._arguments.replace);
await TextEditor.replace(new vscode.Range(line, 0, line, newContent.length), newContent);
await TextEditor.replace(
new vscode.Range(line, 0, line, originalContent.length),
newContent
);
}
matchPos += match.length;
}
Expand Down

0 comments on commit 7054ea0

Please sign in to comment.