diff options
author | Tobias Hunger <tobias.hunger@nokia.com> | 2011-04-08 10:42:07 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@nokia.com> | 2011-04-08 10:58:06 +0200 |
commit | a6ec8e29eafe1f4cf4c976395e3e0c276f39ad14 (patch) | |
tree | 96cab6bb205ec8d7d279304c44b9924ceb7c7638 /src/plugins/vcsbase/vcsbaseeditor.cpp | |
parent | a809a0d2a665258ea0dc4a9851b71142a993d923 (diff) | |
download | qt-creator-a6ec8e29eafe1f4cf4c976395e3e0c276f39ad14.tar.gz |
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
Diffstat (limited to 'src/plugins/vcsbase/vcsbaseeditor.cpp')
-rw-r--r-- | src/plugins/vcsbase/vcsbaseeditor.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 428e26a6a1..f735fb7fe7 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)) { |