diff --git a/README.md b/README.md
index 1cd93ac..0c584af 100644
--- a/README.md
+++ b/README.md
@@ -80,6 +80,7 @@ Here are just some of the features that GitLens provides,
- a [_GitLens_ explorer](#gitlens-explorer 'Jump to the GitLens explorer') to navigate and explore repositories
- a [_GitLens File History_ explorer](#gitlens-file-history-explorer 'Jump to the GitLens File History explorer') to navigate and explore file histories
+- a [_GitLens Line History_ explorer](#gitlens-line-history-explorer 'Jump to the GitLens Line History explorer') to navigate and explore file line histories
- an on-demand [_GitLens Results_ explorer](#gitlens-results-explorer 'Jump to the GitLens Results explorer') to navigate and explore commit searches, visualize comparisons between branches, tags, commits, and more
- authorship [code lens](#code-lens 'Jump to the Code Lens') showing the most recent commit and # of authors to the top of files and/or on code blocks
- an unobtrusive [current line blame](#current-line-blame 'Jump to the Current Line Blame') annotation at the end of the line
@@ -233,10 +234,31 @@ A [customizable](#gitlens-file-history-explorer-settings 'Jump to the GitLens Fi
- A toolbar provides a _Refresh_ command
- A context menu provides a _Follow Renames_ or _Don't Follow Renames_ command
-The file history view provides the revision history of the current file, which has the following features,
+The file history explorer provides the revision history of the current file, which has the following features,
- Automatically updates to track the current editor
-- A context menu provides _Open File_, _Open File in Remote_ (if available), and _Refresh_ commands
+- A context menu provides _Open File_, _Open File in Remote_ (if available), _Copy Remote File Url to Clipboard_ (if available), and _Refresh_ commands
+- An inline toolbar provides an _Open File_ command
+- Context menus for each revision (commit) provides
+ - _Open Changes_, _Open Changes with Working File_, _Open File_, _Open Revision_, _Open File in Remote_ (if available), _Open Revision in Remote_ (if available), _Apply Changes_, _Compare with Selected_ (when available), _Select for Compare_, and _Show Commit File Details_ commands
+
+---
+
+### GitLens Line History Explorer
+
+
+
+
+
+A [customizable](#gitlens-line-history-explorer-settings 'Jump to the GitLens Line History Explorer settings') explorer to visualize the revision history of the selected lines of current file.
+
+- A toolbar provides a _Refresh_ command
+ - A context menu provides a _Follow Renames_ or _Don't Follow Renames_ command
+
+The line history explorer provides the revision history of the selected lines in the current file, which has the following features,
+
+- Automatically updates to track the selection of the current editor
+- A context menu provides _Open File_, _Open File in Remote_ (if available), _Copy Remote File Url to Clipboard_ (if available), and _Refresh_ commands
- An inline toolbar provides an _Open File_ command
- Context menus for each revision (commit) provides
- _Open Changes_, _Open Changes with Working File_, _Open File_, _Open Revision_, _Open File in Remote_ (if available), _Open Revision in Remote_ (if available), _Apply Changes_, _Compare with Selected_ (when available), _Select for Compare_, and _Show Commit File Details_ commands
@@ -681,10 +703,21 @@ See also [Explorer Settings](#explorer-settings 'Jump to the Explorer settings')
See also [Explorer Settings](#explorer-settings 'Jump to the Explorer settings')
-| Name | Description |
-| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `gitlens.historyExplorer.enabled` | Specifies whether to show the current file history undocked in a _GitLens File History_ explorer |
-| `gitlens.historyExplorer.location` | Specifies where to show the _GitLens File History_ explorer `gitlens` - adds to the GitLens view `explorer` - adds to the Explorer view `scm` - adds to the Source Control view |
+| Name | Description |
+| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `gitlens.fileHistoryExplorer.avatars` | Specifies whether to show avatar images instead of status icons in the `GitLens File History` explorer |
+| `gitlens.fileHistoryExplorer.enabled` | Specifies whether to show the _GitLens File History_ explorer |
+| `gitlens.fileHistoryExplorer.location` | Specifies where to show the _GitLens File History_ explorer `gitlens` - adds to the GitLens view `explorer` - adds to the Explorer view `scm` - adds to the Source Control view |
+
+### GitLens Line History Explorer Settings
+
+See also [Explorer Settings](#explorer-settings 'Jump to the Explorer settings')
+
+| Name | Description |
+| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `gitlens.fileHistoryExplorer.avatars` | Specifies whether to show avatar images instead of status icons in the `GitLens Line History` explorer |
+| `gitlens.lineHistoryExplorer.enabled` | Specifies whether to show the _GitLens Line History_ explorer |
+| `gitlens.lineHistoryExplorer.location` | Specifies where to show the _GitLens Line History_ explorer `gitlens` - adds to the GitLens view `explorer` - adds to the Explorer view `scm` - adds to the Source Control view |
### GitLens Results Explorer Settings
@@ -704,6 +737,7 @@ See also [Explorer Settings](#explorer-settings 'Jump to the Explorer settings')
| `gitlens.explorers.avatars` | Specifies whether to show avatar images instead of commit (or status) icons in the _GitLens_ and _GitLens Results_ explorers |
| `gitlens.explorers.commitFileFormat` | Specifies the format of a committed file in the _GitLens_ and _GitLens Results_ explorers Available tokens ${directory} - directory name ${file} - file name ${filePath} - formatted file name and path ${path} - full file path |
| `gitlens.explorers.commitFormat` | Specifies the format of committed changes in the _GitLens_ and _GitLens Results_ explorers Available tokens ${id} - commit id ${author} - commit author ${message} - commit message ${ago} - relative commit date (e.g. 1 day ago) ${date} - formatted commit date (format specified by `gitlens.statusBar.dateFormat`) ${agoOrDate} - commit date specified by `gitlens.defaultDateStyle` ${authorAgo} - commit author, relative commit date ${authorAgoOrDate} - commit author, commit date specified by `gitlens.defaultDateStyle` See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting |
+| `gitlens.explorers.defaultItemLimit` | Specifies the default number of items to show in an explorer list. Use 0 to specify no limit |
| `gitlens.explorers.stashFileFormat` | Specifies the format of a stashed file in the _GitLens_ and _GitLens Results_ explorers Available tokens ${directory} - directory name ${file} - file name ${filePath} - formatted file name and path ${path} - full file path |
| `gitlens.explorers.stashFormat` | Specifies the format of stashed changes in the _GitLens_ and _GitLens Results_ explorers Available tokens ${id} - commit id ${author} - commit author ${message} - commit message ${ago} - relative commit date (e.g. 1 day ago) ${date} - formatted commit date (format specified by `gitlens.statusBar.dateFormat`) ${agoOrDate} - commit date specified by `gitlens.defaultDateStyle` ${authorAgo} - commit author, relative commit date ${authorAgoOrDate} - commit author, commit date specified by `gitlens.defaultDateStyle` See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting |
| `gitlens.explorers.statusFileFormat` | Specifies the format of the status of a working or committed file in the _GitLens_ and _GitLens Results_ explorers Available tokens ${directory} - directory name ${file} - file name ${filePath} - formatted file name and path ${path} - full file path ${working} - optional indicator if the file is uncommitted |
diff --git a/images/dark/icon-repo-blue.svg b/images/dark/icon-repo-blue.svg
new file mode 100644
index 0000000..b51e081
--- /dev/null
+++ b/images/dark/icon-repo-blue.svg
@@ -0,0 +1,5 @@
+
+
\ No newline at end of file
diff --git a/images/light/icon-repo-blue.svg b/images/light/icon-repo-blue.svg
new file mode 100644
index 0000000..455c4a2
--- /dev/null
+++ b/images/light/icon-repo-blue.svg
@@ -0,0 +1,5 @@
+
+
\ No newline at end of file
diff --git a/package.json b/package.json
index 4a01455..a9b911e 100644
--- a/package.json
+++ b/package.json
@@ -455,6 +455,12 @@
"description": "Specifies the format of committed changes in the `GitLens` and `GitLens Results` explorers\nAvailable tokens\n ${id} - commit id\n ${author} - commit author\n ${message} - commit message\n ${ago} - relative commit date (e.g. 1 day ago)\n ${date} - formatted commit date (format specified by `gitlens.defaultDateFormat`)\\n ${agoOrDate} - commit date specified by `gitlens.defaultDateStyle`\n ${authorAgo} - commit author, relative commit date\n ${authorAgoOrDate} - commit author, commit date specified by `gitlens.defaultDateStyle`\nSee https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting",
"scope": "window"
},
+ "gitlens.explorers.defaultItemLimit": {
+ "type": "number",
+ "default": 10,
+ "description": "Specifies the default number of items to show in an explorer list. Use 0 to specify no limit",
+ "scope": "window"
+ },
"gitlens.explorers.stashFileFormat": {
"type": "string",
"default": "${filePath}",
@@ -587,19 +593,19 @@
"description": "Specifies how the gutter heatmap annotations will be toggled",
"scope": "window"
},
- "gitlens.historyExplorer.avatars": {
+ "gitlens.fileHistoryExplorer.avatars": {
"type": "boolean",
"default": true,
"description": "Specifies whether to show avatar images instead of status icons in the `GitLens File History` explorer",
"scope": "window"
},
- "gitlens.historyExplorer.enabled": {
+ "gitlens.fileHistoryExplorer.enabled": {
"type": "boolean",
"default": true,
- "description": "Specifies whether to show the current file history undocked in a `GitLens File History` explorer",
+ "description": "Specifies whether to show the `GitLens File History` explorer",
"scope": "window"
},
- "gitlens.historyExplorer.location": {
+ "gitlens.fileHistoryExplorer.location": {
"type": "string",
"default": "gitlens",
"enum": [
@@ -713,6 +719,34 @@
"description": "Specifies the keymap to use for GitLens shortcut keys",
"scope": "window"
},
+ "gitlens.lineHistoryExplorer.avatars": {
+ "type": "boolean",
+ "default": true,
+ "description": "Specifies whether to show avatar images instead of status icons in the `GitLens Line History` explorer",
+ "scope": "window"
+ },
+ "gitlens.lineHistoryExplorer.enabled": {
+ "type": "boolean",
+ "default": true,
+ "description": "Specifies whether to show the `GitLens Line History` explorer",
+ "scope": "window"
+ },
+ "gitlens.lineHistoryExplorer.location": {
+ "type": "string",
+ "default": "gitlens",
+ "enum": [
+ "gitlens",
+ "explorer",
+ "scm"
+ ],
+ "enumDescriptions": [
+ "Adds to the GitLens view",
+ "Adds to the Explorer view",
+ "Adds to the Source Control view"
+ ],
+ "description": "Specifies where to show the `GitLens Line History` explorer",
+ "scope": "window"
+ },
"gitlens.menus": {
"anyOf": [
{
@@ -1487,11 +1521,16 @@
"category": "GitLens"
},
{
- "command": "gitlens.showHistoryExplorer",
+ "command": "gitlens.showFileHistoryExplorer",
"title": "Show File History Explorer",
"category": "GitLens"
},
{
+ "command": "gitlens.showLineHistoryExplorer",
+ "title": "Show Line History Explorer",
+ "category": "GitLens"
+ },
+ {
"command": "gitlens.showResultsExplorer",
"title": "Show Results Explorer",
"category": "GitLens"
@@ -2008,7 +2047,7 @@
"category": "GitLens"
},
{
- "command": "gitlens.historyExplorer.refresh",
+ "command": "gitlens.fileHistoryExplorer.refresh",
"title": "Refresh",
"category": "GitLens",
"icon": {
@@ -2017,30 +2056,45 @@
}
},
{
- "command": "gitlens.historyExplorer.refreshNode",
+ "command": "gitlens.fileHistoryExplorer.refreshNode",
"title": "Refresh",
"category": "GitLens"
},
{
- "command": "gitlens.historyExplorer.setRenameFollowingOn",
+ "command": "gitlens.fileHistoryExplorer.setRenameFollowingOn",
"title": "Follow Renames",
"category": "GitLens"
},
{
- "command": "gitlens.historyExplorer.setRenameFollowingOff",
+ "command": "gitlens.fileHistoryExplorer.setRenameFollowingOff",
"title": "Don't Follow Renames",
"category": "GitLens"
},
{
- "command": "gitlens.resultsExplorer.clearResultsNode",
- "title": "Clear Results",
+ "command": "gitlens.lineHistoryExplorer.refresh",
+ "title": "Refresh",
"category": "GitLens",
"icon": {
- "dark": "images/dark/icon-close-small.svg",
- "light": "images/light/icon-close-small.svg"
+ "dark": "images/dark/icon-refresh.svg",
+ "light": "images/light/icon-refresh.svg"
}
},
{
+ "command": "gitlens.lineHistoryExplorer.refreshNode",
+ "title": "Refresh",
+ "category": "GitLens"
+ },
+ {
+ "command": "gitlens.lineHistoryExplorer.setRenameFollowingOn",
+ "title": "Follow Renames",
+ "category": "GitLens"
+ },
+ {
+ "command": "gitlens.lineHistoryExplorer.setRenameFollowingOff",
+ "title": "Don't Follow Renames",
+ "category": "GitLens"
+ },
+ {
"command": "gitlens.resultsExplorer.close",
"title": "Close",
"category": "GitLens",
@@ -2050,6 +2104,15 @@
}
},
{
+ "command": "gitlens.resultsExplorer.dismissNode",
+ "title": "Dismiss",
+ "category": "GitLens",
+ "icon": {
+ "dark": "images/dark/icon-close-small.svg",
+ "light": "images/light/icon-close-small.svg"
+ }
+ },
+ {
"command": "gitlens.resultsExplorer.refresh",
"title": "Refresh",
"category": "GitLens",
@@ -2113,12 +2176,13 @@
"when": "gitlens:enabled && gitlens:gitExplorer"
},
{
- "command": "gitlens.showHistoryExplorer",
- "when": "gitlens:enabled && gitlens:historyExplorer"
+ "command": "gitlens.showFileHistoryExplorer",
+ "when": "gitlens:enabled && gitlens:fileHistoryExplorer"
},
{
- "command": "gitlens.showHistoryExplorer",
- "when": "gitlens:enabled && !gitlens:historyExplorer && gitlens:gitExplorer"
+ "command": "gitlens.showLineHistoryExplorer",
+ "title": "Show Line History Explorer",
+ "when": "gitlens:enabled && gitlens:lineHistoryExplorer"
},
{
"command": "gitlens.showResultsExplorer",
@@ -2489,23 +2553,35 @@
"when": "false"
},
{
- "command": "gitlens.historyExplorer.refresh",
+ "command": "gitlens.fileHistoryExplorer.refresh",
+ "when": "false"
+ },
+ {
+ "command": "gitlens.fileHistoryExplorer.refreshNode",
+ "when": "false"
+ },
+ {
+ "command": "gitlens.fileHistoryExplorer.setRenameFollowingOn",
"when": "false"
},
{
- "command": "gitlens.historyExplorer.refreshNode",
+ "command": "gitlens.fileHistoryExplorer.setRenameFollowingOff",
"when": "false"
},
{
- "command": "gitlens.historyExplorer.setRenameFollowingOn",
+ "command": "gitlens.lineHistoryExplorer.refresh",
"when": "false"
},
{
- "command": "gitlens.historyExplorer.setRenameFollowingOff",
+ "command": "gitlens.lineHistoryExplorer.refreshNode",
"when": "false"
},
{
- "command": "gitlens.resultsExplorer.clearResultsNode",
+ "command": "gitlens.lineHistoryExplorer.setRenameFollowingOn",
+ "when": "false"
+ },
+ {
+ "command": "gitlens.lineHistoryExplorer.setRenameFollowingOff",
"when": "false"
},
{
@@ -2513,6 +2589,10 @@
"when": "false"
},
{
+ "command": "gitlens.resultsExplorer.dismissNode",
+ "when": "false"
+ },
+ {
"command": "gitlens.resultsExplorer.refresh",
"when": "false"
},
@@ -2807,18 +2887,33 @@
"group": "2_gitlens"
},
{
- "command": "gitlens.historyExplorer.refresh",
- "when": "view =~ /^gitlens.historyExplorer:/",
+ "command": "gitlens.fileHistoryExplorer.refresh",
+ "when": "view =~ /^gitlens.fileHistoryExplorer:/",
+ "group": "navigation@1"
+ },
+ {
+ "command": "gitlens.fileHistoryExplorer.setRenameFollowingOn",
+ "when": "view =~ /^gitlens.fileHistoryExplorer:/ && !config.gitlens.advanced.fileHistoryFollowsRenames",
+ "group": "1_gitlens"
+ },
+ {
+ "command": "gitlens.fileHistoryExplorer.setRenameFollowingOff",
+ "when": "view =~ /^gitlens.fileHistoryExplorer:/ && config.gitlens.advanced.fileHistoryFollowsRenames",
+ "group": "1_gitlens"
+ },
+ {
+ "command": "gitlens.lineHistoryExplorer.refresh",
+ "when": "view =~ /^gitlens.lineHistoryExplorer:/",
"group": "navigation@1"
},
{
- "command": "gitlens.historyExplorer.setRenameFollowingOn",
- "when": "view =~ /^gitlens.historyExplorer:/ && !config.gitlens.advanced.fileHistoryFollowsRenames",
+ "command": "gitlens.lineHistoryExplorer.setRenameFollowingOn",
+ "when": "view =~ /^gitlens.lineHistoryExplorer:/ && !config.gitlens.advanced.fileHistoryFollowsRenames",
"group": "1_gitlens"
},
{
- "command": "gitlens.historyExplorer.setRenameFollowingOff",
- "when": "view =~ /^gitlens.historyExplorer:/ && config.gitlens.advanced.fileHistoryFollowsRenames",
+ "command": "gitlens.lineHistoryExplorer.setRenameFollowingOff",
+ "when": "view =~ /^gitlens.lineHistoryExplorer:/ && config.gitlens.advanced.fileHistoryFollowsRenames",
"group": "1_gitlens"
},
{
@@ -3089,16 +3184,6 @@
"group": "1_gitlens@1"
},
{
- "command": "gitlens.openRepoInRemote",
- "when": "viewItem == gitlens:status && gitlens:hasRemotes",
- "group": "1_gitlens@1"
- },
- {
- "command": "gitlens.explorers.closeRepository",
- "when": "viewItem == gitlens:status",
- "group": "8_gitlens@1"
- },
- {
"command": "gitlens.openBranchesInRemote",
"when": "viewItem == gitlens:remote",
"group": "1_gitlens@1"
@@ -3134,19 +3219,19 @@
"group": "inline@1"
},
{
- "command": "gitlens.resultsExplorer.clearResultsNode",
+ "command": "gitlens.resultsExplorer.dismissNode",
"when": "viewItem =~ /gitlens:results\\b(?!:(commits|files))/",
"group": "inline@2"
},
{
- "command": "gitlens.resultsExplorer.clearResultsNode",
+ "command": "gitlens.resultsExplorer.dismissNode",
"when": "viewItem =~ /gitlens:results\\b(?!:(commits|files))/",
"group": "1_gitlens@1"
},
{
"command": "gitlens.resultsExplorer.swapComparision",
"when": "viewItem == gitlens:results:comparison",
- "group": "1_gitlens@2"
+ "group": "2_gitlens@1"
},
{
"command": "gitlens.explorers.openDirectoryDiff",
@@ -3184,8 +3269,13 @@
"group": "9_gitlens@1"
},
{
- "command": "gitlens.historyExplorer.refreshNode",
- "when": "view =~ /^gitlens.historyExplorer:/ && viewItem =~ /gitlens:(?!file\\b)/",
+ "command": "gitlens.fileHistoryExplorer.refreshNode",
+ "when": "view =~ /^gitlens.fileHistoryExplorer:/ && viewItem =~ /gitlens:(?!file\\b)/",
+ "group": "9_gitlens@1"
+ },
+ {
+ "command": "gitlens.lineHistoryExplorer.refreshNode",
+ "when": "view =~ /^gitlens.lineHistoryExplorer:/ && viewItem =~ /gitlens:(?!file\\b)/",
"group": "9_gitlens@1"
}
]
@@ -3390,13 +3480,18 @@
"gitlens": [
{
"id": "gitlens.gitExplorer:gitlens",
- "name": "Explorer",
+ "name": "Repositories",
"when": "gitlens:enabled && gitlens:gitExplorer == gitlens"
},
{
- "id": "gitlens.historyExplorer:gitlens",
+ "id": "gitlens.fileHistoryExplorer:gitlens",
"name": "File History",
- "when": "gitlens:enabled && gitlens:historyExplorer == gitlens"
+ "when": "gitlens:enabled && gitlens:fileHistoryExplorer == gitlens"
+ },
+ {
+ "id": "gitlens.lineHistoryExplorer:gitlens",
+ "name": "Line History",
+ "when": "gitlens:enabled && gitlens:lineHistoryExplorer == gitlens"
},
{
"id": "gitlens.resultsExplorer:gitlens",
@@ -3411,9 +3506,14 @@
"when": "gitlens:enabled && gitlens:gitExplorer == explorer"
},
{
- "id": "gitlens.historyExplorer:explorer",
+ "id": "gitlens.fileHistoryExplorer:explorer",
"name": "GitLens File History",
- "when": "gitlens:enabled && gitlens:historyExplorer == explorer"
+ "when": "gitlens:enabled && gitlens:fileHistoryExplorer == explorer"
+ },
+ {
+ "id": "gitlens.lineHistoryExplorer:explorer",
+ "name": "Line History",
+ "when": "gitlens:enabled && gitlens:lineHistoryExplorer == explorer"
},
{
"id": "gitlens.resultsExplorer:explorer",
@@ -3428,9 +3528,14 @@
"when": "gitlens:enabled && gitlens:gitExplorer == scm"
},
{
- "id": "gitlens.historyExplorer:scm",
+ "id": "gitlens.fileHistoryExplorer:scm",
"name": "GitLens File History",
- "when": "gitlens:enabled && gitlens:historyExplorer == scm"
+ "when": "gitlens:enabled && gitlens:fileHistoryExplorer == scm"
+ },
+ {
+ "id": "gitlens.lineHistoryExplorer:scm",
+ "name": "Line History",
+ "when": "gitlens:enabled && gitlens:lineHistoryExplorer == scm"
},
{
"id": "gitlens.resultsExplorer:scm",
diff --git a/src/commands.ts b/src/commands.ts
index bd37f7b..0f2566e 100644
--- a/src/commands.ts
+++ b/src/commands.ts
@@ -26,8 +26,7 @@ import { OpenRepoInRemoteCommand } from './commands/openRepoInRemote';
import { OpenWorkingFileCommand } from './commands/openWorkingFile';
import { ResetSuppressedWarningsCommand } from './commands/resetSuppressedWarnings';
import { ShowCommitSearchCommand } from './commands/showCommitSearch';
-import { ShowGitExplorerCommand } from './commands/showGitExplorer';
-import { ShowHistoryExplorerCommand } from './commands/showHistoryExplorer';
+import { ShowExplorerCommand } from './commands/showExplorer';
import { ShowLastQuickPickCommand } from './commands/showLastQuickPick';
import { ShowQuickBranchHistoryCommand } from './commands/showQuickBranchHistory';
import { ShowQuickCommitDetailsCommand } from './commands/showQuickCommitDetails';
@@ -36,7 +35,6 @@ import { ShowQuickCurrentBranchHistoryCommand } from './commands/showQuickCurren
import { ShowQuickFileHistoryCommand } from './commands/showQuickFileHistory';
import { ShowQuickRepoStatusCommand } from './commands/showQuickRepoStatus';
import { ShowQuickStashListCommand } from './commands/showQuickStashList';
-import { ShowResultsExplorerCommand } from './commands/showResultsExplorer';
import { StashApplyCommand } from './commands/stashApply';
import { StashDeleteCommand } from './commands/stashDelete';
import { StashSaveCommand } from './commands/stashSave';
@@ -77,8 +75,7 @@ export * from './commands/openRepoInRemote';
export * from './commands/openWorkingFile';
export * from './commands/resetSuppressedWarnings';
export * from './commands/showCommitSearch';
-export * from './commands/showGitExplorer';
-export * from './commands/showHistoryExplorer';
+export * from './commands/showExplorer';
export * from './commands/showLastQuickPick';
export * from './commands/showQuickBranchHistory';
export * from './commands/showQuickCommitDetails';
@@ -87,7 +84,6 @@ export * from './commands/showQuickCurrentBranchHistory';
export * from './commands/showQuickFileHistory';
export * from './commands/showQuickRepoStatus';
export * from './commands/showQuickStashList';
-export * from './commands/showResultsExplorer';
export * from './commands/stashApply';
export * from './commands/stashDelete';
export * from './commands/stashSave';
@@ -128,8 +124,7 @@ export function configureCommands(): void {
Container.context.subscriptions.push(new OpenWorkingFileCommand());
Container.context.subscriptions.push(new ResetSuppressedWarningsCommand());
Container.context.subscriptions.push(new ShowCommitSearchCommand());
- Container.context.subscriptions.push(new ShowGitExplorerCommand());
- Container.context.subscriptions.push(new ShowHistoryExplorerCommand());
+ Container.context.subscriptions.push(new ShowExplorerCommand());
Container.context.subscriptions.push(new ShowLastQuickPickCommand());
Container.context.subscriptions.push(new ShowQuickBranchHistoryCommand());
Container.context.subscriptions.push(new ShowQuickCommitDetailsCommand());
@@ -138,7 +133,6 @@ export function configureCommands(): void {
Container.context.subscriptions.push(new ShowQuickFileHistoryCommand());
Container.context.subscriptions.push(new ShowQuickRepoStatusCommand());
Container.context.subscriptions.push(new ShowQuickStashListCommand());
- Container.context.subscriptions.push(new ShowResultsExplorerCommand());
Container.context.subscriptions.push(new StashApplyCommand());
Container.context.subscriptions.push(new StashDeleteCommand());
Container.context.subscriptions.push(new StashSaveCommand());
diff --git a/src/commands/common.ts b/src/commands/common.ts
index 707fcf1..b2b3c80 100644
--- a/src/commands/common.ts
+++ b/src/commands/common.ts
@@ -56,7 +56,8 @@ export enum Commands {
ResetSuppressedWarnings = 'gitlens.resetSuppressedWarnings',
ShowCommitSearch = 'gitlens.showCommitSearch',
ShowGitExplorer = 'gitlens.showGitExplorer',
- ShowHistoryExplorer = 'gitlens.showHistoryExplorer',
+ ShowFileHistoryExplorer = 'gitlens.showFileHistoryExplorer',
+ ShowLineHistoryExplorer = 'gitlens.showLineHistoryExplorer',
ShowLastQuickPick = 'gitlens.showLastQuickPick',
ShowQuickCommitDetails = 'gitlens.showQuickCommitDetails',
ShowQuickCommitFileDetails = 'gitlens.showQuickCommitFileDetails',
diff --git a/src/commands/diffBranchWithBranch.ts b/src/commands/diffBranchWithBranch.ts
index 0edcfe2..912cba2 100644
--- a/src/commands/diffBranchWithBranch.ts
+++ b/src/commands/diffBranchWithBranch.ts
@@ -80,7 +80,7 @@ export class DiffBranchWithBranchCommand extends ActiveEditorCommand {
if (args.ref1 === undefined) return undefined;
}
- await Container.resultsExplorer.showComparisonInResults(repoPath, args.ref1, args.ref2);
+ await Container.resultsExplorer.addComparison(repoPath, args.ref1, args.ref2);
return undefined;
}
diff --git a/src/commands/diffDirectory.ts b/src/commands/diffDirectory.ts
index 3e6c8b0..b413e48 100644
--- a/src/commands/diffDirectory.ts
+++ b/src/commands/diffDirectory.ts
@@ -5,7 +5,7 @@ import { Container } from '../container';
import { Logger } from '../logger';
import { Messages } from '../messages';
import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickpicks';
-import { ComparisonResultsNode } from '../views/nodes';
+import { ResultsComparisonNode } from '../views/nodes';
import {
ActiveEditorCommand,
CommandContext,
@@ -38,7 +38,7 @@ export class DiffDirectoryCommand extends ActiveEditorCommand {
break;
case Commands.ExplorersOpenDirectoryDiff:
- if (context.type === 'view' && context.node instanceof ComparisonResultsNode) {
+ if (context.type === 'view' && context.node instanceof ResultsComparisonNode) {
args.ref1 = context.node.ref1.ref;
args.ref2 = context.node.ref2.ref;
}
diff --git a/src/commands/showExplorer.ts b/src/commands/showExplorer.ts
new file mode 100644
index 0000000..e110521
--- /dev/null
+++ b/src/commands/showExplorer.ts
@@ -0,0 +1,33 @@
+'use strict';
+import { Container } from '../container';
+import { Command, CommandContext, Commands } from './common';
+
+export class ShowExplorerCommand extends Command {
+ constructor() {
+ super([
+ Commands.ShowGitExplorer,
+ Commands.ShowFileHistoryExplorer,
+ Commands.ShowLineHistoryExplorer,
+ Commands.ShowResultsExplorer
+ ]);
+ }
+
+ protected async preExecute(context: CommandContext): Promise {
+ return this.execute(context.command as Commands);
+ }
+
+ execute(command: Commands) {
+ switch (command) {
+ case Commands.ShowGitExplorer:
+ return Container.gitExplorer.show();
+ case Commands.ShowFileHistoryExplorer:
+ return Container.fileHistoryExplorer.show();
+ case Commands.ShowLineHistoryExplorer:
+ return Container.lineHistoryExplorer.show();
+ case Commands.ShowResultsExplorer:
+ return Container.resultsExplorer.show();
+ }
+
+ return undefined;
+ }
+}
diff --git a/src/commands/showGitExplorer.ts b/src/commands/showGitExplorer.ts
deleted file mode 100644
index 9f55969..0000000
--- a/src/commands/showGitExplorer.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict';
-import { Container } from '../container';
-import { Command, Commands } from './common';
-
-export class ShowGitExplorerCommand extends Command {
- constructor() {
- super(Commands.ShowGitExplorer);
- }
-
- execute() {
- return Container.gitExplorer.show();
- }
-}
diff --git a/src/commands/showHistoryExplorer.ts b/src/commands/showHistoryExplorer.ts
deleted file mode 100644
index 8bf6968..0000000
--- a/src/commands/showHistoryExplorer.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict';
-import { Container } from '../container';
-import { Command, Commands } from './common';
-
-export class ShowHistoryExplorerCommand extends Command {
- constructor() {
- super(Commands.ShowHistoryExplorer);
- }
-
- execute() {
- return Container.historyExplorer.show();
- }
-}
diff --git a/src/commands/showResultsExplorer.ts b/src/commands/showResultsExplorer.ts
deleted file mode 100644
index 0914624..0000000
--- a/src/commands/showResultsExplorer.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict';
-import { Container } from '../container';
-import { Command, Commands } from './common';
-
-export class ShowResultsExplorerCommand extends Command {
- constructor() {
- super(Commands.ShowResultsExplorer);
- }
-
- execute() {
- return Container.resultsExplorer.show();
- }
-}
diff --git a/src/configuration.ts b/src/configuration.ts
index f953b84..5a6e6f9 100644
--- a/src/configuration.ts
+++ b/src/configuration.ts
@@ -43,8 +43,9 @@ export class Configuration {
`gitlens.${this.name('codeLens').value}`,
`gitlens.${this.name('currentLine').value}`,
`gitlens.${this.name('gitExplorer').value}`,
- `gitlens.${this.name('historyExplorer').value}`,
+ `gitlens.${this.name('fileHistoryExplorer').value}`,
`gitlens.${this.name('hovers').value}`,
+ `gitlens.${this.name('lineHistoryExplorer').value}`,
`gitlens.${this.name('statusBar').value}`
];
}
diff --git a/src/constants.ts b/src/constants.ts
index 1b199f8..df61cee 100644
--- a/src/constants.ts
+++ b/src/constants.ts
@@ -33,7 +33,8 @@ export enum CommandContext {
GitExplorer = 'gitlens:gitExplorer',
GitExplorerAutoRefresh = 'gitlens:gitExplorer:autoRefresh',
HasRemotes = 'gitlens:hasRemotes',
- HistoryExplorer = 'gitlens:historyExplorer',
+ FileHistoryExplorer = 'gitlens:fileHistoryExplorer',
+ LineHistoryExplorer = 'gitlens:lineHistoryExplorer',
Key = 'gitlens:key',
KeyMap = 'gitlens:keymap',
ResultsExplorer = 'gitlens:resultsExplorer',
diff --git a/src/container.ts b/src/container.ts
index 10ca797..e7f2d01 100644
--- a/src/container.ts
+++ b/src/container.ts
@@ -12,8 +12,9 @@ import { StatusBarController } from './statusbar/statusBarController';
import { GitDocumentTracker } from './trackers/gitDocumentTracker';
import { GitLineTracker } from './trackers/gitLineTracker';
import { ExplorerCommands } from './views/explorerCommands';
+import { FileHistoryExplorer } from './views/fileHistoryExplorer';
import { GitExplorer } from './views/gitExplorer';
-import { HistoryExplorer } from './views/historyExplorer';
+import { LineHistoryExplorer } from './views/lineHistoryExplorer';
import { ResultsExplorer } from './views/resultsExplorer';
import { SettingsEditor } from './webviews/settingsEditor';
import { WelcomeEditor } from './webviews/welcomeEditor';
@@ -52,15 +53,28 @@ export class Container {
});
}
- if (config.historyExplorer.enabled) {
- context.subscriptions.push((this._historyExplorer = new HistoryExplorer()));
+ if (config.fileHistoryExplorer.enabled) {
+ context.subscriptions.push((this._fileHistoryExplorer = new FileHistoryExplorer()));
}
else {
let disposable: Disposable;
disposable = configuration.onDidChange(e => {
- if (configuration.changed(e, configuration.name('historyExplorer')('enabled').value)) {
+ if (configuration.changed(e, configuration.name('fileHistoryExplorer')('enabled').value)) {
disposable.dispose();
- context.subscriptions.push((this._historyExplorer = new HistoryExplorer()));
+ context.subscriptions.push((this._fileHistoryExplorer = new FileHistoryExplorer()));
+ }
+ });
+ }
+
+ if (config.lineHistoryExplorer.enabled) {
+ context.subscriptions.push((this._lineHistoryExplorer = new LineHistoryExplorer()));
+ }
+ else {
+ let disposable: Disposable;
+ disposable = configuration.onDidChange(e => {
+ if (configuration.changed(e, configuration.name('lineHistoryExplorer')('enabled').value)) {
+ disposable.dispose();
+ context.subscriptions.push((this._lineHistoryExplorer = new LineHistoryExplorer()));
}
});
}
@@ -99,6 +113,15 @@ export class Container {
return this._fileAnnotationController;
}
+ private static _fileHistoryExplorer: FileHistoryExplorer | undefined;
+ static get fileHistoryExplorer() {
+ if (this._fileHistoryExplorer === undefined) {
+ this._context.subscriptions.push((this._fileHistoryExplorer = new FileHistoryExplorer()));
+ }
+
+ return this._fileHistoryExplorer;
+ }
+
private static _git: GitService;
static get git() {
return this._git;
@@ -109,15 +132,6 @@ export class Container {
return this._gitExplorer!;
}
- private static _historyExplorer: HistoryExplorer | undefined;
- static get historyExplorer() {
- if (this._historyExplorer === undefined) {
- this._context.subscriptions.push((this._historyExplorer = new HistoryExplorer()));
- }
-
- return this._historyExplorer;
- }
-
private static _keyboard: Keyboard;
static get keyboard() {
return this._keyboard;
@@ -128,6 +142,15 @@ export class Container {
return this._lineAnnotationController;
}
+ private static _lineHistoryExplorer: LineHistoryExplorer | undefined;
+ static get lineHistoryExplorer() {
+ if (this._lineHistoryExplorer === undefined) {
+ this._context.subscriptions.push((this._lineHistoryExplorer = new LineHistoryExplorer()));
+ }
+
+ return this._lineHistoryExplorer;
+ }
+
private static _lineHoverController: LineHoverController;
static get lineHovers() {
return this._lineHoverController;
@@ -187,7 +210,7 @@ export class Container {
config.gitExplorer.enabled = mode.explorers;
}
if (mode.explorers != null) {
- config.historyExplorer.enabled = mode.explorers;
+ config.fileHistoryExplorer.enabled = mode.explorers;
}
if (mode.hovers != null) {
config.hovers.enabled = mode.hovers;
diff --git a/src/extension.ts b/src/extension.ts
index 6ea20a5..6d721e3 100644
--- a/src/extension.ts
+++ b/src/extension.ts
@@ -2,17 +2,7 @@
import { commands, ExtensionContext, extensions, window, workspace } from 'vscode';
import { Commands, configureCommands } from './commands';
-import {
- CodeLensLanguageScope,
- CodeLensScopes,
- configuration,
- Configuration,
- HighlightLocations,
- IConfig,
- IMenuConfig,
- KeyMap,
- OutputLevel
-} from './configuration';
+import { configuration, Configuration, IConfig } from './configuration';
import { CommandContext, extensionQualifiedId, GlobalState, GlyphChars, setCommandContext } from './constants';
import { Container } from './container';
import { GitService } from './git/gitService';
@@ -41,6 +31,22 @@ export async function activate(context: ExtensionContext) {
Configuration.configure(context);
+ const cfg = configuration.get();
+
+ // Pretend we are enabled (until we know otherwise) and set the explorer contexts to reduce flashing on load
+ await Promise.all([
+ setCommandContext(CommandContext.Enabled, true),
+ setCommandContext(CommandContext.GitExplorer, cfg.gitExplorer.enabled ? cfg.gitExplorer.location : false),
+ setCommandContext(
+ CommandContext.FileHistoryExplorer,
+ cfg.fileHistoryExplorer.enabled ? cfg.fileHistoryExplorer.location : false
+ ),
+ setCommandContext(
+ CommandContext.LineHistoryExplorer,
+ cfg.lineHistoryExplorer.enabled ? cfg.lineHistoryExplorer.location : false
+ )
+ ]);
+
const previousVersion = context.globalState.get(GlobalState.GitLensVersion);
await migrateSettings(context, previousVersion);
@@ -60,7 +66,6 @@ export async function activate(context: ExtensionContext) {
return;
}
- const cfg = configuration.get();
Container.initialize(context, cfg);
configureCommands();
@@ -94,385 +99,32 @@ async function migrateSettings(context: ExtensionContext, previousVersion: strin
const previous = Versions.fromString(previousVersion);
try {
- if (Versions.compare(previous, Versions.from(7, 5, 10)) !== 1) {
- await configuration.migrate(
- 'annotations.file.gutter.gravatars',
- configuration.name('blame')('avatars').value
- );
- await configuration.migrate(
- 'annotations.file.gutter.compact',
- configuration.name('blame')('compact').value
- );
- await configuration.migrate(
- 'annotations.file.gutter.dateFormat',
- configuration.name('blame')('dateFormat').value
- );
- await configuration.migrate('annotations.file.gutter.format', configuration.name('blame')('format').value);
- await configuration.migrate(
- 'annotations.file.gutter.heatmap.enabled',
- configuration.name('blame')('heatmap')('enabled').value
- );
- await configuration.migrate(
- 'annotations.file.gutter.heatmap.location',
- configuration.name('blame')('heatmap')('location').value
- );
- await configuration.migrate(
- 'annotations.file.gutter.lineHighlight.enabled',
- configuration.name('blame')('highlight')('enabled').value
- );
- await configuration.migrate(
- 'annotations.file.gutter.lineHighlight.locations',
- configuration.name('blame')('highlight')('locations').value
- );
- await configuration.migrate(
- 'annotations.file.gutter.separateLines',
- configuration.name('blame')('separateLines').value
- );
-
- await configuration.migrate('codeLens.locations', configuration.name('codeLens')('scopes').value);
- await configuration.migrate<
- { customSymbols?: string[]; language: string | undefined; locations: CodeLensScopes[] }[],
- CodeLensLanguageScope[]
- >('codeLens.perLanguageLocations', configuration.name('codeLens')('scopesByLanguage').value, {
- migrationFn: v => {
- const scopes = v.map(ls => {
- return {
- language: ls.language,
- scopes: ls.locations,
- symbolScopes: ls.customSymbols
- };
- });
- return scopes;
- }
- });
- await configuration.migrate(
- 'codeLens.customLocationSymbols',
- configuration.name('codeLens')('symbolScopes').value
- );
-
- await configuration.migrate(
- 'annotations.line.trailing.dateFormat',
- configuration.name('currentLine')('dateFormat').value
- );
- await configuration.migrate('blame.line.enabled', configuration.name('currentLine')('enabled').value);
- await configuration.migrate(
- 'annotations.line.trailing.format',
- configuration.name('currentLine')('format').value
- );
-
+ if (Versions.compare(previous, Versions.from(9, 0, 0)) !== 1) {
await configuration.migrate(
- 'annotations.file.gutter.hover.changes',
- configuration.name('hovers')('annotations')('changes').value
+ 'historyExplorer.avatars',
+ configuration.name('fileHistoryExplorer')('avatars').value
);
await configuration.migrate(
- 'annotations.file.gutter.hover.details',
- configuration.name('hovers')('annotations')('details').value
+ 'historyExplorer.enabled',
+ configuration.name('fileHistoryExplorer')('enabled').value
);
await configuration.migrate(
- 'annotations.file.gutter.hover.details',
- configuration.name('hovers')('annotations')('enabled').value
- );
- await configuration.migrate(
- 'annotations.file.gutter.hover.wholeLine',
- configuration.name('hovers')('annotations')('over').value,
- { migrationFn: v => (v ? 'line' : 'annotation') }
+ 'historyExplorer.location',
+ configuration.name('fileHistoryExplorer')('location').value
);
await configuration.migrate(
- 'annotations.line.trailing.hover.changes',
- configuration.name('hovers')('currentLine')('changes').value
- );
- await configuration.migrate(
- 'annotations.line.trailing.hover.details',
- configuration.name('hovers')('currentLine')('details').value
+ 'historyExplorer.avatars',
+ configuration.name('lineHistoryExplorer')('avatars').value
);
await configuration.migrate(
- 'blame.line.enabled',
- configuration.name('hovers')('currentLine')('enabled').value
+ 'historyExplorer.enabled',
+ configuration.name('lineHistoryExplorer')('enabled').value
);
- await configuration.migrate(
- 'annotations.line.trailing.hover.wholeLine',
- configuration.name('hovers')('currentLine')('over').value,
- { migrationFn: v => (v ? 'line' : 'annotation') }
- );
-
- await configuration.migrate('gitExplorer.gravatars', configuration.name('explorers')('avatars').value);
await configuration.migrate(
- 'gitExplorer.commitFileFormat',
- configuration.name('explorers')('commitFileFormat').value
- );
- await configuration.migrate(
- 'gitExplorer.commitFormat',
- configuration.name('explorers')('commitFormat').value
- );
- await configuration.migrate(
- 'gitExplorer.stashFileFormat',
- configuration.name('explorers')('stashFileFormat').value
- );
- await configuration.migrate(
- 'gitExplorer.stashFormat',
- configuration.name('explorers')('stashFormat').value
- );
- await configuration.migrate(
- 'gitExplorer.statusFileFormat',
- configuration.name('explorers')('statusFileFormat').value
- );
-
- await configuration.migrate(
- 'recentChanges.file.lineHighlight.locations',
- configuration.name('recentChanges')('highlight')('locations').value
- );
- }
-
- if (Versions.compare(previous, Versions.from(8, 0, 0, 'beta2')) !== 1) {
- await configuration.migrate('debug', configuration.name('outputLevel').value, {
- migrationFn: v =>
- v ? OutputLevel.Debug : configuration.get(configuration.name('outputLevel').value)
- });
- await configuration.migrate('debug', configuration.name('debug').value, { migrationFn: v => undefined });
- }
-
- if (Versions.compare(previous, Versions.from(8, 0, 0, 'rc')) !== 1) {
- let section = configuration.name('blame')('highlight')('locations').value;
- await configuration.migrate<('gutter' | 'line' | 'overviewRuler')[], HighlightLocations[]>(
- section,
- section,
- {
- migrationFn: v => {
- const index = v.indexOf('overviewRuler');
- if (index !== -1) {
- v.splice(index, 1, 'overview' as 'overviewRuler');
- }
- return v as HighlightLocations[];
- }
- }
- );
-
- section = configuration.name('recentChanges')('highlight')('locations').value;
- await configuration.migrate<('gutter' | 'line' | 'overviewRuler')[], HighlightLocations[]>(
- section,
- section,
- {
- migrationFn: v => {
- const index = v.indexOf('overviewRuler');
- if (index !== -1) {
- v.splice(index, 1, 'overview' as 'overviewRuler');
- }
- return v as HighlightLocations[];
- }
- }
- );
- }
-
- if (Versions.compare(previous, Versions.from(8, 0, 0)) !== 1) {
- await configuration.migrateIfMissing(
- 'annotations.file.gutter.gravatars',
- configuration.name('blame')('avatars').value
- );
- await configuration.migrateIfMissing(
- 'annotations.file.gutter.compact',
- configuration.name('blame')('compact').value
- );
- await configuration.migrateIfMissing(
- 'annotations.file.gutter.dateFormat',
- configuration.name('blame')('dateFormat').value
- );
- await configuration.migrateIfMissing(
- 'annotations.file.gutter.format',
- configuration.name('blame')('format').value
- );
- await configuration.migrateIfMissing(
- 'annotations.file.gutter.heatmap.enabled',
- configuration.name('blame')('heatmap')('enabled').value
- );
- await configuration.migrateIfMissing(
- 'annotations.file.gutter.heatmap.location',
- configuration.name('blame')('heatmap')('location').value
- );
- await configuration.migrateIfMissing(
- 'annotations.file.gutter.lineHighlight.enabled',
- configuration.name('blame')('highlight')('enabled').value
- );
- await configuration.migrateIfMissing(
- 'annotations.file.gutter.lineHighlight.locations',
- configuration.name('blame')('highlight')('locations').value
- );
- await configuration.migrateIfMissing(
- 'annotations.file.gutter.separateLines',
- configuration.name('blame')('separateLines').value
- );
-
- await configuration.migrateIfMissing('codeLens.locations', configuration.name('codeLens')('scopes').value);
- await configuration.migrateIfMissing<
- { customSymbols?: string[]; language: string | undefined; locations: CodeLensScopes[] }[],
- CodeLensLanguageScope[]
- >('codeLens.perLanguageLocations', configuration.name('codeLens')('scopesByLanguage').value, {
- migrationFn: v => {
- const scopes = v.map(ls => {
- return {
- language: ls.language,
- scopes: ls.locations,
- symbolScopes: ls.customSymbols
- };
- });
- return scopes;
- }
- });
- await configuration.migrateIfMissing(
- 'codeLens.customLocationSymbols',
- configuration.name('codeLens')('symbolScopes').value
- );
-
- await configuration.migrateIfMissing(
- 'annotations.line.trailing.dateFormat',
- configuration.name('currentLine')('dateFormat').value
- );
- await configuration.migrateIfMissing(
- 'blame.line.enabled',
- configuration.name('currentLine')('enabled').value
- );
- await configuration.migrateIfMissing(
- 'annotations.line.trailing.format',
- configuration.name('currentLine')('format').value
+ 'historyExplorer.location',
+ configuration.name('lineHistoryExplorer')('location').value
);
-
- await configuration.migrateIfMissing(
- 'annotations.file.gutter.hover.changes',
- configuration.name('hovers')('annotations')('changes').value
- );
- await configuration.migrateIfMissing(
- 'annotations.file.gutter.hover.details',
- configuration.name('hovers')('annotations')('details').value
- );
- await configuration.migrateIfMissing(
- 'annotations.file.gutter.hover.details',
- configuration.name('hovers')('annotations')('enabled').value
- );
- await configuration.migrateIfMissing(
- 'annotations.file.gutter.hover.wholeLine',
- configuration.name('hovers')('annotations')('over').value,
- { migrationFn: v => (v ? 'line' : 'annotation') }
- );
-
- await configuration.migrateIfMissing(
- 'annotations.line.trailing.hover.changes',
- configuration.name('hovers')('currentLine')('changes').value
- );
- await configuration.migrateIfMissing(
- 'annotations.line.trailing.hover.details',
- configuration.name('hovers')('currentLine')('details').value
- );
- await configuration.migrateIfMissing(
- 'blame.line.enabled',
- configuration.name('hovers')('currentLine')('enabled').value
- );
- await configuration.migrateIfMissing(
- 'annotations.line.trailing.hover.wholeLine',
- configuration.name('hovers')('currentLine')('over').value,
- { migrationFn: v => (v ? 'line' : 'annotation') }
- );
-
- await configuration.migrateIfMissing(
- 'gitExplorer.gravatars',
- configuration.name('explorers')('avatars').value
- );
- await configuration.migrateIfMissing(
- 'gitExplorer.commitFileFormat',
- configuration.name('explorers')('commitFileFormat').value
- );
- await configuration.migrateIfMissing(
- 'gitExplorer.commitFormat',
- configuration.name('explorers')('commitFormat').value
- );
- await configuration.migrateIfMissing(
- 'gitExplorer.stashFileFormat',
- configuration.name('explorers')('stashFileFormat').value
- );
- await configuration.migrateIfMissing(
- 'gitExplorer.stashFormat',
- configuration.name('explorers')('stashFormat').value
- );
- await configuration.migrateIfMissing(
- 'gitExplorer.statusFileFormat',
- configuration.name('explorers')('statusFileFormat').value
- );
-
- await configuration.migrateIfMissing(
- 'recentChanges.file.lineHighlight.locations',
- configuration.name('recentChanges')('highlight')('locations').value
- );
- }
-
- if (Versions.compare(previous, Versions.from(8, 0, 2)) !== 1) {
- const section = configuration.name('keymap').value;
- await configuration.migrate<'standard' | 'chorded' | 'none', KeyMap>(section, section, {
- fallbackValue: KeyMap.Alternate,
- migrationFn: v => (v === 'standard' ? KeyMap.Alternate : (v as KeyMap))
- });
- }
-
- if (Versions.compare(previous, Versions.from(8, 2, 4)) !== 1) {
- await configuration.migrate<
- {
- explorerContext: {
- fileDiff: boolean;
- history: boolean;
- remote: boolean;
- };
- editorContext: {
- blame: boolean;
- copy: boolean;
- details: boolean;
- fileDiff: boolean;
- history: boolean;
- lineDiff: boolean;
- remote: boolean;
- };
- editorTitle: {
- blame: boolean;
- fileDiff: boolean;
- history: boolean;
- remote: boolean;
- status: boolean;
- };
- editorTitleContext: {
- blame: boolean;
- fileDiff: boolean;
- history: boolean;
- remote: boolean;
- };
- },
- IMenuConfig
- >('advanced.menus', configuration.name('menus').value, {
- migrationFn: m => {
- return {
- editor: {
- blame: !!m.editorContext.blame,
- clipboard: !!m.editorContext.copy,
- compare: !!m.editorContext.lineDiff,
- details: !!m.editorContext.details,
- history: !!m.editorContext.history,
- remote: !!m.editorContext.remote
- },
- editorGroup: {
- blame: !!m.editorTitle.blame,
- compare: !!m.editorTitle.fileDiff,
- history: !!m.editorTitle.history,
- remote: !!m.editorTitle.remote
- },
- editorTab: {
- compare: !!m.editorTitleContext.fileDiff,
- history: !!m.editorTitleContext.history,
- remote: !!m.editorTitleContext.remote
- },
- explorer: {
- compare: !!m.explorerContext.fileDiff,
- history: !!m.explorerContext.history,
- remote: !!m.explorerContext.remote
- }
- } as IMenuConfig;
- }
- });
}
}
catch (ex) {
diff --git a/src/git/models/repository.ts b/src/git/models/repository.ts
index 31d2148..dc5363b 100644
--- a/src/git/models/repository.ts
+++ b/src/git/models/repository.ts
@@ -218,13 +218,13 @@ export class Repository implements Disposable {
}
}
- // containsUri(uri: Uri) {
- // if (uri instanceof GitUri) {
- // uri = uri.repoPath !== undefined ? Uri.file(uri.repoPath) : uri.documentUri();
- // }
+ containsUri(uri: Uri) {
+ if (uri instanceof GitUri) {
+ uri = uri.repoPath !== undefined ? Uri.file(uri.repoPath) : uri.documentUri();
+ }
- // return this.folder === workspace.getWorkspaceFolder(uri);
- // }
+ return this.folder === workspace.getWorkspaceFolder(uri);
+ }
getBranch(): Promise {
if (this._branch === undefined) {
diff --git a/src/quickpicks/commonQuickPicks.ts b/src/quickpicks/commonQuickPicks.ts
index 42f2eec..cb34465 100644
--- a/src/quickpicks/commonQuickPicks.ts
+++ b/src/quickpicks/commonQuickPicks.ts
@@ -247,7 +247,7 @@ export class ShowCommitInResultsQuickPickItem extends CommandQuickPickItem {
async execute(
options: TextDocumentShowOptions = { preserveFocus: false, preview: false }
): Promise<{} | undefined> {
- await Container.resultsExplorer.showCommitInResults(this.commit);
+ await Container.resultsExplorer.addCommit(this.commit);
return undefined;
}
}
@@ -267,7 +267,7 @@ export class ShowCommitsInResultsQuickPickItem extends CommandQuickPickItem {
async execute(
options: TextDocumentShowOptions = { preserveFocus: false, preview: false }
): Promise<{} | undefined> {
- Container.resultsExplorer.showCommitsInResults(this.results, this.resultsLabel);
+ await Container.resultsExplorer.addSearchResults(this.results, this.resultsLabel);
return undefined;
}
}
diff --git a/src/ui/config.ts b/src/ui/config.ts
index b6a9219..543e58e 100644
--- a/src/ui/config.ts
+++ b/src/ui/config.ts
@@ -161,6 +161,7 @@ export interface IExplorersConfig {
commitFileFormat: string;
commitFormat: string;
// dateFormat: string | null;
+ defaultItemLimit: number;
stashFileFormat: string;
stashFormat: string;
@@ -187,12 +188,14 @@ export interface IGitExplorerConfig {
showTrackingBranch: boolean;
}
-export interface IHistoryExplorerConfig {
+export interface IFileHistoryExplorerConfig {
avatars: boolean;
enabled: boolean;
- location: 'explorer' | 'scm';
+ location: 'explorer' | 'gitlens' | 'scm';
}
+export interface ILineHistoryExplorerConfig extends IFileHistoryExplorerConfig {}
+
export interface IMenuConfig {
editor:
| boolean
@@ -239,7 +242,7 @@ export interface IModeConfig {
export interface IResultsExplorerConfig {
files: IExplorersFilesConfig;
- location: 'explorer' | 'scm';
+ location: 'explorer' | 'gitlens' | 'scm';
}
export interface IRemotesConfig {
@@ -306,7 +309,7 @@ export interface IConfig {
toggleMode: AnnotationsToggleMode;
};
- historyExplorer: IHistoryExplorerConfig;
+ fileHistoryExplorer: IFileHistoryExplorerConfig;
hovers: {
annotations: {
@@ -329,6 +332,7 @@ export interface IConfig {
insiders: boolean;
keymap: KeyMap;
+ lineHistoryExplorer: ILineHistoryExplorerConfig;
menus: boolean | IMenuConfig;
mode: {
active: string;
diff --git a/src/ui/settings/index.html b/src/ui/settings/index.html
index 0ef7ef7..812627b 100644
--- a/src/ui/settings/index.html
+++ b/src/ui/settings/index.html
@@ -50,8 +50,10 @@
Alt based (
- ⌥ on macOS) shortcuts. Not great for non-English keyboard layouts
+ ⌥ on macOS) shortcuts. Not great for
+ non-English keyboard layouts
Chorded shortcuts that start with
Ctrl+Shift+G (
- ⌥⌘G on macOS). Better for non-English keyboard layouts
+ ⌥⌘G on macOS). Better for
+ non-English keyboard layouts
GitLens won't bind any keyboard shortcuts. Configure your own via the
- Keyboard Shortcuts editor
+ Keyboard
+ Shortcuts editor
@@ -116,7 +122,8 @@
gitlens in the
- Keyboard Shortcuts editor to see the shortcuts and to customize them further
+ Keyboard
+ Shortcuts editor to see the shortcuts and to customize them further
@@ -124,7 +131,8 @@
Any changes to menu & toolbar settings will require a
- reload before they will take effect
+ reload
+ before they will take effect
@@ -133,105 +141,138 @@
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -239,7 +280,8 @@
For more advanced customizations open
- User Settings and search for
+ User
+ Settings and search for
gitlens
@@ -254,7 +296,8 @@
-
Adds a GitLens explorer to navigate and explore repositories or file histories
+
Adds a GitLens explorer to navigate and explore repositories
+ or file histories
@@ -265,61 +308,76 @@
-
-
+
-
+
-
+
-
+
-
Chooses the best layout based on the number of files at each nesting level
+
Chooses
+ the best layout based on the number of files at each nesting level
-
-
+
+
-
Compacts (flattens) unnecessary nesting when using a tree layouts
+
Compacts
+ (flattens) unnecessary nesting when using a tree layouts
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
For more advanced customizations open
- User Settings and search for
+ User
+ Settings and search for
gitlens.gitExplorer or
@@ -337,34 +395,83 @@
-
Adds a GitLens File History explorer to visualize the revision history of the current file
+
Adds a GitLens File History explorer to visualize the
+ revision history of the current file
Adds an on-demand GitLens Results explorer to navigate and explore commits, histories, and searches,
+
Adds an on-demand GitLens Results explorer to navigate and
+ explore commits, histories, and searches,
or visualize comparisons between branches, tags, commits, and more
@@ -400,10 +508,12 @@
-
+
-
Compacts (flattens) unnecessary nesting when using a tree layouts
+
Compacts
+ (flattens) unnecessary nesting when using a tree layouts
@@ -412,19 +522,20 @@
-
-
-
-
+
+
+
+
For more advanced customizations open
- User Settings and search for
+ User
+ Settings and search for
gitlens.resultsExplorer or
@@ -442,7 +553,8 @@
-
Adds authorship code lens to the top of files and on code blocks
+
Adds authorship code lens to the top of files and on code
+ blocks
Commit Date
-
+ Absolute, e.g. August 8th, 2016 10:48am
@@ -738,7 +885,7 @@
Commit Date
-
+ Relative or absolute based on date setting
@@ -747,7 +894,7 @@
Commit Author, Commit Date
-
+ Relative date
@@ -756,7 +903,7 @@
Commit Author, Commit Date
-
+ Relative or absolute date
@@ -767,21 +914,26 @@
- Learn more about advanced formatting options
+ Learn more about advanced
+ formatting options
-
+
-
Indicator color reflects the age of the most recent change (hot or cold), while indicator
+
Indicator color reflects the age of the most recent change
+ (hot or cold), while indicator
brightness ranges from bright (newer) to dim (older) based on the relative age
Adds on-demand heatmap (age) indicator to the edge of the gutter to show how recently lines were
+
Adds on-demand heatmap (age) indicator to the edge of the
+ gutter to show how recently lines were
changed
- Indicator color reflects the age of the most recent change (hot or cold), while indicator
+ Indicator color reflects the age of the most recent change (hot or cold), while
+ indicator
brightness ranges from bright (newer) to dim (older) based on the relative age