Procházet zdrojové kódy

Closes #1505: open folder history on root folders

main
Eric Amodio před 3 roky
rodič
revize
7a272ad30f
3 změnil soubory, kde provedl 12 přidání a 1 odebrání
  1. +1
    -0
      CHANGELOG.md
  2. +1
    -1
      package.json
  3. +10
    -0
      src/views/nodes/fileHistoryNode.ts

+ 1
- 0
CHANGELOG.md Zobrazit soubor

@ -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 Zobrazit soubor

@ -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 Zobrazit soubor

@ -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})`}`

Načítá se…
Zrušit
Uložit