forked from qt-creator/qt-creator
DiffEditor: Fix newline handling for not the last chunk
Task-number: QTCREATORBUG-12665 Change-Id: I7a54fa5502d3e06c6e1ccd99dec800f80e217333 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -775,7 +775,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch()
|
|||||||
QCOMPARE(resultChunkData.leftStartingLineNumber, origChunkData.leftStartingLineNumber);
|
QCOMPARE(resultChunkData.leftStartingLineNumber, origChunkData.leftStartingLineNumber);
|
||||||
QCOMPARE(resultChunkData.rightStartingLineNumber, origChunkData.rightStartingLineNumber);
|
QCOMPARE(resultChunkData.rightStartingLineNumber, origChunkData.rightStartingLineNumber);
|
||||||
QCOMPARE(resultChunkData.contextChunk, origChunkData.contextChunk);
|
QCOMPARE(resultChunkData.contextChunk, origChunkData.contextChunk);
|
||||||
QEXPECT_FAIL("2 chunks - first ends with blank line", "QTCREATORBUG-12665", Abort);
|
|
||||||
QCOMPARE(resultChunkData.rows.count(), origChunkData.rows.count());
|
QCOMPARE(resultChunkData.rows.count(), origChunkData.rows.count());
|
||||||
for (int k = 0; k < origChunkData.rows.count(); k++) {
|
for (int k = 0; k < origChunkData.rows.count(); k++) {
|
||||||
const RowData &origRowData = origChunkData.rows.at(k);
|
const RowData &origRowData = origChunkData.rows.at(k);
|
||||||
|
|||||||
@@ -604,7 +604,7 @@ static QList<RowData> readLines(const QString &patch,
|
|||||||
} else {
|
} else {
|
||||||
if (noNewLineInEqual >= 0) {
|
if (noNewLineInEqual >= 0) {
|
||||||
removeNewLineFromLastEqual = true;
|
removeNewLineFromLastEqual = true;
|
||||||
} else if (lastChunk) {
|
} else {
|
||||||
if (lastEqual > lastDelete && lastEqual > lastInsert) {
|
if (lastEqual > lastDelete && lastEqual > lastInsert) {
|
||||||
removeNewLineFromLastEqual = true;
|
removeNewLineFromLastEqual = true;
|
||||||
} else if (lastDelete > lastEqual && lastDelete > lastInsert) {
|
} else if (lastDelete > lastEqual && lastDelete > lastInsert) {
|
||||||
|
|||||||
Reference in New Issue
Block a user