Commit a4b00160 authored by jkobus's avatar jkobus Committed by Jarek Kobus
Browse files

Refactor diff editor widget, fix whitespaces handling



Prepare for ignoreNewLine handling

Task-number: QTCREATORBUG-11002

Change-Id: I97fc0887ef27c821252283ccbad655ac0bc79f0a
Reviewed-by: default avatarJarek Kobus <jaroslaw.kobus@digia.com>
parent 66f8437b
This diff is collapsed.
......@@ -102,18 +102,13 @@ private:
};
void setDiff(const QList<DiffList> &diffList);
bool isWhitespace(const QChar &c) const;
bool isWhitespace(const Diff &diff) const;
bool isEqual(const QList<Diff> &diffList, int diffNumber) const;
void handleWhitespaces(const QList<Diff> &input,
QList<Diff> *leftOutput,
QList<Diff> *rightOutput) const;
QList<QTextEdit::ExtraSelection> colorPositions(const QTextCharFormat &format,
QTextCursor &cursor,
const QMap<int, int> &positions) const;
void colorDiff(const QList<FileData> &fileDataList);
QList<TextLineData> assemblyRows(const QStringList &lines,
const QMap<int, int> &lineSpans,
const QMap<int, int> &changedPositions,
QMap<int, int> *outputChangedPositions) const;
ChunkData calculateOriginalData(const QList<Diff> &diffList) const;
FileData calculateContextData(const ChunkData &originalData) const;
void showDiff();
void synchronizeFoldings(DiffViewEditorWidget *source, DiffViewEditorWidget *destination);
......@@ -125,7 +120,7 @@ private:
QSplitter *m_splitter;
QList<DiffList> m_diffList; // list of original outputs from differ
QList<ChunkData> m_originalChunkData; // one big chunk for every file, ignoreWhitespaces taken into account
QList<ChunkData> m_originalChunkData; // one big chunk for every file, ignoreWhitespace taken into account
QList<FileData> m_contextFileData; // ultimate data to be shown, contextLinesNumber taken into account
bool m_foldingBlocker;
......
......@@ -747,7 +747,7 @@ QList<Diff> Differ::cleanupSemantics(const QList<Diff> &diffList)
}
}
return cleanupOverlaps(cleanupSemanticsLossless(merge(newDiffList)));
return cleanupOverlaps(merge(cleanupSemanticsLossless(merge(newDiffList))));
}
QList<Diff> Differ::cleanupSemanticsLossless(const QList<Diff> &diffList)
......
Markdown is supported
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