Commit dd50b729 authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Fix hunk balancing with multi-file diffs

parent dfb0d98a
Pipeline #246181 passed with stage
in 37 minutes and 23 seconds
......@@ -572,6 +572,7 @@ void DiffWidget::parseAndShowDiff(const QByteArray &raw)
if (m_params.flags.testFlag(DiffParams::ShowFileName)) {
left.append(Utils::fileNameFromPath(srcFile));
right.append(Utils::fileNameFromPath(tgtFile));
Q_ASSERT(left.size() == right.size() && lineA == lineB);
linesWithFileName.append(lineA);
lineNumsA.append(-1);
lineNumsB.append(-1);
......@@ -670,6 +671,7 @@ void DiffWidget::parseAndShowDiff(const QByteArray &raw)
lineB += 1;
break;
} else if (l.startsWith(QStringLiteral("diff --git "))) {
balanceHunkLines(left, right, lineA, lineB, lineNumsA, lineNumsB);
// Start of a new file
markInlineDiffs(hunkChangedLinesA, hunkChangedLinesB, leftHlts, rightHlts);
// add new line
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment