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

Fixing issue 14163, F&R replaces all content of file when replacing new line #14175

Merged
merged 1 commit into from
May 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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