diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 428e26a6a18..f735fb7fe76 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -755,6 +755,11 @@ DiffChunk VCSBaseEditorWidget::diffChunk(QTextCursor cursor) const DiffChunk rc; // Search back for start of chunk. QTextBlock block = cursor.block(); + QTextBlock next = block.next(); + if (next.isValid() && TextEditor::BaseTextDocumentLayout::foldingIndent(next) <= 1) + /* We are in a diff header, not in a chunk! DiffHighlighter sets the foldingIndent for us. */ + return rc; + int chunkStart = 0; for ( ; block.isValid() ; block = block.previous()) { if (checkChunkLine(block.text(), &chunkStart)) {