From 55ef004332ed8a205c17f301af413877fd25f8a8 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 19 Jun 2017 23:23:20 -0400 Subject: [PATCH] Fixes changes hover not showing the correct diff when showing recent changes annotations --- src/annotations/recentChangesAnnotationProvider.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/annotations/recentChangesAnnotationProvider.ts b/src/annotations/recentChangesAnnotationProvider.ts index 2c24d3a..dd111d3 100644 --- a/src/annotations/recentChangesAnnotationProvider.ts +++ b/src/annotations/recentChangesAnnotationProvider.ts @@ -50,7 +50,8 @@ export class RecentChangesAnnotationProvider extends AnnotationProviderBase { let message: string | undefined = undefined; if (cfg.hover.changes) { - message = Annotations.getHoverDiffMessage(commit, chunk.previous[count], change); + const previousPos = count - (chunk.previousPosition.start + (chunk.previousPosition.start - chunk.currentPosition.start)) + 1; + message = Annotations.getHoverDiffMessage(commit, chunk.previous[previousPos], change); } decorators.push({