From ac0f273081c6294d43c39f1ba4af848bd36da683 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Tue, 16 May 2023 15:18:36 +0200 Subject: 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 Reviewed-by: --- src/plugins/git/gitplugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); -- cgit v1.2.1