Git: Fix Instant Blame for files with only one line

As we don't show blame annotations for the trailing
(empty) lines, the following could happen for single
line files:

1. Cursor is in the first line, annotation is shown
2. Cursor is moved to the last line, the annotation
   is cleared
3. Cursor is moved back to the first line, but now
   no annotation is shown

Fix this by resetting the last visited line when the
annotation is cleared in step 2.

Change-Id: I1ea5dc339f57c94bc1835dcbccd7a9d93f79ffe5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2023-12-06 21:40:22 +01:00
committed by André Hartmann
parent d1ac2fe45a
commit e944a26435

View File

@@ -1577,6 +1577,7 @@ void GitPluginPrivate::instantBlame()
if (line >= lines) { if (line >= lines) {
m_blameMark.reset(); m_blameMark.reset();
m_lastVisitedEditorLine = -1;
return; return;
} }