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>
This commit is contained in:
Andre Hartmann
2023-05-16 15:18:36 +02:00
committed by André Hartmann
parent f84199f8b7
commit ac0f273081

View File

@@ -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();