From a6ec8e29eafe1f4cf4c976395e3e0c276f39ad14 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 8 Apr 2011 10:42:07 +0200 Subject: [PATCH] VCS: Do not offer to revert a chunk when in a diff header Do not offer to revert a chunk when in a diff header --- src/plugins/vcsbase/vcsbaseeditor.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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)) {