Skip to content

Commit e7ce9a0

Browse files
committed
Adds status to tooltip of commit file nodes
1 parent bee45e1 commit e7ce9a0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1616
- Adds control over the contributed menu commands to the Source Control side bar to the GitLens interactive settings editor (via the `gitlens.menus` setting)
1717
- Adds Git extended regex support to commit searches
1818
- 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)
19+
- Adds the changed file status (added, modified, renamed, deleted, etc) to the tooltip of each revision in the _File History_ and _Line History_ views
1920

2021
### Changed
2122

src/views/nodes/commitFileNode.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,11 @@ export class CommitFileNode extends ViewRefNode {
143143
get tooltip() {
144144
if (this._tooltip === undefined) {
145145
if (this._displayAs & CommitFileNodeDisplayAs.CommitLabel) {
146+
const status = StatusFileFormatter.fromTemplate('${status}', this.file);
146147
this._tooltip = CommitFormatter.fromTemplate(
147148
this.commit.isUncommitted
148-
? `\${author} ${GlyphChars.Dash} \${id}\n\${ago} (\${date})`
149-
: `\${author} ${GlyphChars.Dash} \${id}\n\${ago} (\${date})\n\n\${message}`,
149+
? `\${author} ${GlyphChars.Dash} \${id}\n${status}\n\${ago} (\${date})`
150+
: `\${author} ${GlyphChars.Dash} \${id}\n${status}\n\${ago} (\${date})\n\n\${message}`,
150151
this.commit,
151152
{
152153
dateFormat: Container.config.defaultDateFormat

0 commit comments

Comments
 (0)