From 9fad4e65ab0e231d9349a5e96cfa845ae703f9a8 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 16 Mar 2022 17:30:05 -0400 Subject: [PATCH] Changes hover to show at the cursor --- CHANGELOG.md | 3 +-- src/hovers/lineHoverController.ts | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd890cb..33f8f7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,12 +8,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Changed +- Changes the current line blame hover to show at the cursor, rather than the start of the line, when showing the hover over the whole line (e.g. line & annotation) - Changes the default of showing PR information in the current line blame annotation to reduce overhead (e.g. GitHub queries) ### Fixed -# - - Fixes [#1829](https://github.com/gitkraken/vscode-gitlens/issues/1829) - Reduce re-rendering by disabling animation in blame info in the status bar - Fixes [#1864](https://github.com/gitkraken/vscode-gitlens/issues/1864) - Worktrees fail to load in working path with spaces - Fixes [#1881](https://github.com/gitkraken/vscode-gitlens/issues/1881) - Worktrees icon is very small diff --git a/src/hovers/lineHoverController.ts b/src/hovers/lineHoverController.ts index fbd8a4f..9a4e6f5 100644 --- a/src/hovers/lineHoverController.ts +++ b/src/hovers/lineHoverController.ts @@ -114,7 +114,12 @@ export class LineHoverController implements Disposable { if (!wholeLine && this.container.lineAnnotations.suspended) return undefined; const range = document.validateRange( - new Range(position.line, wholeLine ? 0 : maxSmallIntegerV8, position.line, maxSmallIntegerV8), + new Range( + position.line, + wholeLine ? position.character : maxSmallIntegerV8, + position.line, + maxSmallIntegerV8, + ), ); if (!wholeLine && range.start.character !== position.character) return undefined; @@ -171,7 +176,12 @@ export class LineHoverController implements Disposable { if (!wholeLine && this.container.lineAnnotations.suspended) return undefined; const range = document.validateRange( - new Range(position.line, wholeLine ? 0 : maxSmallIntegerV8, position.line, maxSmallIntegerV8), + new Range( + position.line, + wholeLine ? position.character : maxSmallIntegerV8, + position.line, + maxSmallIntegerV8, + ), ); if (!wholeLine && range.start.character !== position.character) return undefined;