Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
dd50b729
Commit
dd50b729
authored
Oct 10, 2022
by
Waqar Ahmed
Committed by
Christoph Cullmann
Oct 11, 2022
Browse files
Fix hunk balancing with multi-file diffs
parent
dfb0d98a
Pipeline
#246181
passed with stage
in 37 minutes and 23 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
apps/lib/diff/diffwidget.cpp
View file @
dd50b729
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment