summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjkobus <jaroslaw.kobus@digia.com>2014-03-12 11:53:51 +0100
committerJarek Kobus <jaroslaw.kobus@digia.com>2014-03-12 11:55:19 +0100
commitf4db27a65c4b144c4394cdfdcc29e623b781be07 (patch)
tree4c03f6793c0876429a2026fb1cb6ca7c52f3cdec /src
parent541b5141f2c5a2e7babf44e71ff6f579e302a61a (diff)
downloadqt-creator-f4db27a65c4b144c4394cdfdcc29e623b781be07.tar.gz
Reorder coloring inside diff editor
Display properly separators in differences Change-Id: Ia7aa1f1ee96a07e0ed96773e8363e68f3d3a5638 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/diffeditor/sidebysidediffeditorwidget.cpp34
1 files changed, 13 insertions, 21 deletions
diff --git a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp
index 8c593170f3..6da541b0ec 100644
--- a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp
+++ b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp
@@ -1120,27 +1120,19 @@ void SideBySideDiffEditorWidget::colorDiff(const QList<FileData> &fileDataList)
QTextCursor leftCursor = m_leftEditor->textCursor();
QTextCursor rightCursor = m_rightEditor->textCursor();
- QList<QTextEdit::ExtraSelection> leftSelections
- = colorPositions(m_leftLineFormat, leftCursor, leftLinePos);
- leftSelections
- += colorPositions(m_chunkLineFormat, leftCursor, leftChunkPos);
- leftSelections
- += colorPositions(m_fileLineFormat, leftCursor, leftFilePos);
- leftSelections
- += colorPositions(spanLineFormat, leftCursor, leftSkippedPos);
- leftSelections
- += colorPositions(m_leftCharFormat, leftCursor, leftCharPos);
-
- QList<QTextEdit::ExtraSelection> rightSelections
- = colorPositions(m_rightLineFormat, rightCursor, rightLinePos);
- rightSelections
- += colorPositions(m_chunkLineFormat, rightCursor, rightChunkPos);
- rightSelections
- += colorPositions(m_fileLineFormat, rightCursor, rightFilePos);
- rightSelections
- += colorPositions(spanLineFormat, rightCursor, rightSkippedPos);
- rightSelections
- += colorPositions(m_rightCharFormat, rightCursor, rightCharPos);
+ QList<QTextEdit::ExtraSelection> leftSelections;
+ leftSelections += colorPositions(m_leftLineFormat, leftCursor, leftLinePos);
+ leftSelections += colorPositions(m_leftCharFormat, leftCursor, leftCharPos);
+ leftSelections += colorPositions(spanLineFormat, leftCursor, leftSkippedPos);
+ leftSelections += colorPositions(m_chunkLineFormat, leftCursor, leftChunkPos);
+ leftSelections += colorPositions(m_fileLineFormat, leftCursor, leftFilePos);
+
+ QList<QTextEdit::ExtraSelection> rightSelections;
+ rightSelections += colorPositions(m_rightLineFormat, rightCursor, rightLinePos);
+ rightSelections += colorPositions(m_rightCharFormat, rightCursor, rightCharPos);
+ rightSelections += colorPositions(spanLineFormat, rightCursor, rightSkippedPos);
+ rightSelections += colorPositions(m_chunkLineFormat, rightCursor, rightChunkPos);
+ rightSelections += colorPositions(m_fileLineFormat, rightCursor, rightFilePos);
m_leftEditor->setExtraSelections(BaseTextEditorWidget::OtherSelection, leftSelections);
m_rightEditor->setExtraSelections(BaseTextEditorWidget::OtherSelection, rightSelections);