summaryrefslogtreecommitdiff
path: root/src/plugins/vcsbase/vcsbaseeditor.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@nokia.com>2011-04-08 10:40:59 +0200
committerTobias Hunger <tobias.hunger@nokia.com>2011-04-08 10:58:05 +0200
commita809a0d2a665258ea0dc4a9851b71142a993d923 (patch)
treedb1edb357dbc9b05f253f1f6b29ed23cbb8a3380 /src/plugins/vcsbase/vcsbaseeditor.cpp
parent1f99db9d8f548e3beb8f6bdf41897038efc982ff (diff)
downloadqt-creator-a809a0d2a665258ea0dc4a9851b71142a993d923.tar.gz
VCS: Do not jump to any file when in the diff header
Do not jump to a file on double-click when in a diff header. Task-number: QTCREATORBUG-4364
Diffstat (limited to 'src/plugins/vcsbase/vcsbaseeditor.cpp')
-rw-r--r--src/plugins/vcsbase/vcsbaseeditor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp
index 5b1dccd666..428e26a6a1 100644
--- a/src/plugins/vcsbase/vcsbaseeditor.cpp
+++ b/src/plugins/vcsbase/vcsbaseeditor.cpp
@@ -49,6 +49,7 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/project.h>
#include <projectexplorer/session.h>
+#include <texteditor/basetextdocumentlayout.h>
#include <texteditor/fontsettings.h>
#include <texteditor/texteditorconstants.h>
#include <utils/qtcassert.h>
@@ -708,6 +709,9 @@ void VCSBaseEditorWidget::jumpToChangeFromDiff(QTextCursor cursor)
const QChar deletionIndicator = QLatin1Char('-');
// find nearest change hunk
QTextBlock block = cursor.block();
+ if (TextEditor::BaseTextDocumentLayout::foldingIndent(block) <= 1)
+ /* We are in a diff header, do not jump anywhere. DiffHighlighter sets the foldingIndent for us. */
+ return;
for ( ; block.isValid() ; block = block.previous()) {
const QString line = block.text();
if (checkChunkLine(line, &chunkStart)) {