Ver código fonte

Closes #1505: open folder history on root folders

main
Eric Amodio 3 anos atrás
pai
commit
7a272ad30f
3 arquivos alterados com 12 adições e 1 exclusões
  1. +1
    -0
      CHANGELOG.md
  2. +1
    -1
      package.json
  3. +10
    -0
      src/views/nodes/fileHistoryNode.ts

+ 1
- 0
CHANGELOG.md Ver arquivo

@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Added
- Adds the ability to filter comparisons to show only either the left-side or right-side file differences
- Adds the _Open Folder History_ command to root folders — closes [#1505](https://github.com/eamodio/vscode-gitlens/issues/1505)
### Changed

+ 1
- 1
package.json Ver arquivo

@ -6824,7 +6824,7 @@
},
{
"command": "gitlens.openFolderHistory",
"when": "!explorerResourceIsRoot && explorerResourceIsFolder && gitlens:enabled && config.gitlens.menus.explorer.history",
"when": "explorerResourceIsFolder && gitlens:enabled && config.gitlens.menus.explorer.history",
"group": "4_timeline@2"
},
{

+ 10
- 0
src/views/nodes/fileHistoryNode.ts Ver arquivo

@ -1,4 +1,5 @@
'use strict';
import * as paths from 'path';
import { Disposable, TreeItem, TreeItemCollapsibleState, window } from 'vscode';
import { LoadMoreNode, MessageNode } from './common';
import { CommitNode } from './commitNode';
@ -146,6 +147,15 @@ export class FileHistoryNode extends SubscribeableViewNode impl
}
get label() {
// Check if this is a base folder
if (this.uri.fileName === '') {
return `${paths.basename(this.uri.fsPath)}${
this.uri.sha
? ` ${this.uri.sha === GitRevision.deletedOrMissing ? this.uri.shortSha : `(${this.uri.shortSha})`}`
: ''
}`;
}
return `${this.uri.fileName}${
this.uri.sha
? ` ${this.uri.sha === GitRevision.deletedOrMissing ? this.uri.shortSha : `(${this.uri.shortSha})`}`

Carregando…
Cancelar
Salvar