From e944a26435d46e12eaaf20831557ee26c4c2143a Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Wed, 6 Dec 2023 21:40:22 +0100 Subject: [PATCH] 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 --- src/plugins/git/gitplugin.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 24441a0a264..639f671340b 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -1577,6 +1577,7 @@ void GitPluginPrivate::instantBlame() if (line >= lines) { m_blameMark.reset(); + m_lastVisitedEditorLine = -1; return; }