summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2023-05-16 15:18:36 +0200
committerAndré Hartmann <aha_1980@gmx.de>2023-05-17 07:05:33 +0000
commitac0f273081c6294d43c39f1ba4af848bd36da683 (patch)
tree9306591f1aefd8646843c1edf685689852e7828a /src
parentf84199f8b70bb03b66a0dbac3ff4dcdb56094d20 (diff)
downloadqt-creator-ac0f273081c6294d43c39f1ba4af848bd36da683.tar.gz
Git: Fix missing instant blame with line folding
When lines are folded (e.g. the license header), the editors lineCount() is smaller than its blockCount(). That resulted in missing blame marks for the last document lines. E.g. if 10 lines were folded, the last 10 lines did not have blame marks. Change-Id: I502afb09697fd3d6a062d3ae2321357a3e565a0e Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/git/gitplugin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index 7443f0baa3..34baa29d9d 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -1548,7 +1548,7 @@ void GitPluginPrivate::instantBlame()
const QTextCursor cursor = widget->textCursor();
const QTextBlock block = cursor.block();
const int line = block.blockNumber() + 1;
- const int lines = widget->document()->lineCount();
+ const int lines = widget->document()->blockCount();
if (line >= lines) {
m_blameMark.reset();