Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Fixing issue 14163, find and replace replaces all content of file whe…
Browse files Browse the repository at this point in the history
…n replacing new line (#14175)
  • Loading branch information
navch authored and swmitra committed May 18, 2018
1 parent dcfe579 commit 8d95165
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/search/FindInFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ define(function (require, exports, module) {
while ((match = queryExpr.exec(contents)) !== null) {
lineNum = StringUtils.offsetToLineNum(lines, match.index);
line = lines[lineNum];
ch = match.index - contents.lastIndexOf("\n", match.index) - 1; // 0-based index
ch = match.index - contents.lastIndexOf("\n", match.index - 1) - 1; // 0-based index
matchedLines = match[0].split("\n");
numMatchedLines = matchedLines.length;
totalMatchLength = match[0].length;
Expand Down

0 comments on commit 8d95165

Please sign in to comment.