From e7ce9a0b1ddb2eb07b7548da86d6b6d77c336ba7 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 12 Dec 2018 01:00:03 -0500 Subject: [PATCH] Adds status to tooltip of commit file nodes --- CHANGELOG.md | 1 + src/views/nodes/commitFileNode.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86d99f8..4487b62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - Adds control over the contributed menu commands to the Source Control side bar to the GitLens interactive settings editor (via the `gitlens.menus` setting) - Adds Git extended regex support to commit searches - Adds the date and a changes indicator (+x ~x -x) to stashes in GitLens views (uses the new `${changes}` token in the `gitlens.views.stashFormat` setting) +- Adds the changed file status (added, modified, renamed, deleted, etc) to the tooltip of each revision in the _File History_ and _Line History_ views ### Changed diff --git a/src/views/nodes/commitFileNode.ts b/src/views/nodes/commitFileNode.ts index d8a1f4c..d584654 100644 --- a/src/views/nodes/commitFileNode.ts +++ b/src/views/nodes/commitFileNode.ts @@ -143,10 +143,11 @@ export class CommitFileNode extends ViewRefNode { get tooltip() { if (this._tooltip === undefined) { if (this._displayAs & CommitFileNodeDisplayAs.CommitLabel) { + const status = StatusFileFormatter.fromTemplate('${status}', this.file); this._tooltip = CommitFormatter.fromTemplate( this.commit.isUncommitted - ? `\${author} ${GlyphChars.Dash} \${id}\n\${ago} (\${date})` - : `\${author} ${GlyphChars.Dash} \${id}\n\${ago} (\${date})\n\n\${message}`, + ? `\${author} ${GlyphChars.Dash} \${id}\n${status}\n\${ago} (\${date})` + : `\${author} ${GlyphChars.Dash} \${id}\n${status}\n\${ago} (\${date})\n\n\${message}`, this.commit, { dateFormat: Container.config.defaultDateFormat