VCS: Rename DiffHighlighter -> DiffAndLogHighlighter

It is also used for log editors

Change-Id: I8755d2aaa717ca47b0d9bbf935b121d4e099ef1b
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-03-25 10:31:55 +02:00
committed by Orgad Shaneh
parent f98c89ebf3
commit 9877221a3d
10 changed files with 51 additions and 47 deletions

View File

@@ -29,7 +29,7 @@
****************************************************************************/
#include "vcsbaseeditor.h"
#include "diffhighlighter.h"
#include "diffandloghighlighter.h"
#include "baseannotationhighlighter.h"
#include "basevcseditorfactory.h"
#include "vcsbaseplugin.h"
@@ -736,7 +736,7 @@ void VcsBaseEditorWidget::init()
break;
}
if (hasDiff()) {
auto dh = new DiffHighlighter(d->m_diffFilePattern);
auto dh = new DiffAndLogHighlighter(d->m_diffFilePattern);
setCodeFoldingSupported(true);
textDocument()->setSyntaxHighlighter(dh);
}
@@ -1120,9 +1120,11 @@ void VcsBaseEditorWidget::jumpToChangeFromDiff(QTextCursor cursor)
const QChar deletionIndicator = QLatin1Char('-');
// find nearest change hunk
QTextBlock block = cursor.block();
if (TextDocumentLayout::foldingIndent(block) <= 1)
/* We are in a diff header, do not jump anywhere. DiffHighlighter sets the foldingIndent for us. */
if (TextDocumentLayout::foldingIndent(block) <= 1) {
// We are in a diff header, do not jump anywhere.
// DiffAndLogHighlighter sets the foldingIndent for us.
return;
}
for ( ; block.isValid() ; block = block.previous()) {
const QString line = block.text();
if (checkChunkLine(line, &chunkStart)) {
@@ -1159,9 +1161,11 @@ DiffChunk VcsBaseEditorWidget::diffChunk(QTextCursor cursor) const
QTC_ASSERT(hasDiff(), return rc);
// Search back for start of chunk.
QTextBlock block = cursor.block();
if (block.isValid() && TextDocumentLayout::foldingIndent(block) <= 1)
/* We are in a diff header, not in a chunk! DiffHighlighter sets the foldingIndent for us. */
if (block.isValid() && TextDocumentLayout::foldingIndent(block) <= 1) {
// We are in a diff header, not in a chunk!
// DiffAndLogHighlighter sets the foldingIndent for us.
return rc;
}
int chunkStart = 0;
for ( ; block.isValid() ; block = block.previous()) {