aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/refactoringchanges.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2023-06-28 12:47:38 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2023-06-29 11:51:19 +0000
commitbcd49bafdd9432ce7abbd20cceabe853358231c8 (patch)
tree37492e97a0288e58864cdf3211165b7260b7a5ca /src/plugins/texteditor/refactoringchanges.cpp
parent379e7f906e6f1dd8656364f5a2cf4feed2127d0f (diff)
CppEditor: Add test case for quickfix formatting
Also fixes an off-by-one error in the formatting code that was uncovered by the test. Change-Id: I013194e21cf37f318bb806bb60ea659b91b99fbf Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/texteditor/refactoringchanges.cpp')
-rw-r--r--src/plugins/texteditor/refactoringchanges.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp
index dab0ebb41f..1b03a07e01 100644
--- a/src/plugins/texteditor/refactoringchanges.cpp
+++ b/src/plugins/texteditor/refactoringchanges.cpp
@@ -468,7 +468,7 @@ void RefactoringFile::doFormatting()
QTC_ASSERT(b.isValid(), break);
if (b.text().simplified().isEmpty())
QTextCursor(b).insertText(clangFormatLineRemovalBlocker);
- if (b.blockNumber() == r.endLine)
+ if (b.blockNumber() == r.endLine - 1)
break;
b = b.next();
}