diff --git a/package.json b/package.json index a1c81bb..e6b6983 100644 --- a/package.json +++ b/package.json @@ -6525,6 +6525,11 @@ "icon": "$(close)" }, { + "command": "gitlens.views.collapseNode", + "title": "Collapse", + "category": "GitLens" + }, + { "command": "gitlens.views.dismissNode", "title": "Dismiss", "category": "GitLens", @@ -9385,6 +9390,10 @@ "when": "false" }, { + "command": "gitlens.views.collapseNode", + "when": "false" + }, + { "command": "gitlens.views.dismissNode", "when": "false" }, @@ -13081,11 +13090,16 @@ "group": "8_gitlens_actions@98" }, { - "command": "gitlens.views.expandNode", + "command": "gitlens.views.collapseNode", "when": "viewItem =~ /gitlens:(branch|compare|folder|results|search|status)\\b/", "group": "9_gitlens@1" }, { + "command": "gitlens.views.expandNode", + "when": "viewItem =~ /gitlens:(branch|compare|folder|results|search|status)\\b/", + "group": "9_gitlens@2" + }, + { "command": "gitlens.views.refreshNode", "when": "viewItem =~ /gitlens:(?!(file|message|date-marker)\\b)/", "group": "9_gitlens@99" diff --git a/src/constants.ts b/src/constants.ts index 1d56556..c01fc51 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -606,6 +606,7 @@ export type CoreCommands = | 'editor.action.showReferences' | 'editor.action.webvieweditor.showFind' | 'editorScroll' + | 'list.collapseAllToFocus' | 'openInTerminal' | 'revealFileInOS' | 'revealInExplorer' diff --git a/src/views/viewCommands.ts b/src/views/viewCommands.ts index 8326aec..846bd56 100644 --- a/src/views/viewCommands.ts +++ b/src/views/viewCommands.ts @@ -136,6 +136,7 @@ export class ViewCommands { }, this, ); + registerViewCommand('gitlens.views.collapseNode', () => executeCoreCommand('list.collapseAllToFocus'), this); registerViewCommand( 'gitlens.views.dismissNode', (n: ViewNode) => canViewDismissNode(n.view) && n.view.dismissNode(n),