From 7677a34203f3d8b8a3c86d510afe015dae11c823 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 21 Nov 2018 01:42:00 -0500 Subject: [PATCH] Closes #275 - Adds expand menu to some nodes --- package.json | 14 ++++++++++++++ src/views/viewBase.ts | 2 +- src/views/viewCommands.ts | 5 +++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 829823a..6812dff 100644 --- a/package.json +++ b/package.json @@ -2538,6 +2538,11 @@ } }, { + "command": "gitlens.views.expandNode", + "title": "Expand", + "category": "GitLens" + }, + { "command": "gitlens.views.refreshNode", "title": "Refresh", "category": "GitLens" @@ -3106,6 +3111,10 @@ "when": "false" }, { + "command": "gitlens.views.expandNode", + "when": "false" + }, + { "command": "gitlens.views.refreshNode", "when": "false" } @@ -4079,6 +4088,11 @@ "group": "8_gitlens" }, { + "command": "gitlens.views.expandNode", + "when": "view =~ /^gitlens\\.views\\./ && viewItem =~ /gitlens:(compare|folder|results|search|status:files)\\b/", + "group": "8_gitlens@1" + }, + { "command": "gitlens.views.refreshNode", "when": "view =~ /^gitlens\\.views\\./ && viewItem =~ /gitlens:(?!file\\b)/", "group": "9_gitlens@1" diff --git a/src/views/viewBase.ts b/src/views/viewBase.ts index 684a1e9..08772b4 100644 --- a/src/views/viewBase.ts +++ b/src/views/viewBase.ts @@ -16,7 +16,7 @@ import { import { configuration } from '../configuration'; import { Container } from '../container'; import { Logger } from '../logger'; -import { debug, Functions, gate, log } from '../system'; +import { debug, Functions, log } from '../system'; import { CompareView } from './compareView'; import { FileHistoryView } from './fileHistoryView'; import { LineHistoryView } from './lineHistoryView'; diff --git a/src/views/viewCommands.ts b/src/views/viewCommands.ts index 8888c70..1da4c2c 100644 --- a/src/views/viewCommands.ts +++ b/src/views/viewCommands.ts @@ -56,6 +56,11 @@ export class ViewCommands implements Disposable { this ); commands.registerCommand( + 'gitlens.views.expandNode', + (node: ViewNode) => node.view.reveal(node, { select: false, focus: false, expand: 3 }), + this + ); + commands.registerCommand( 'gitlens.views.dismissNode', (node: ViewNode) => canDismissNode(node.view) && node.view.dismissNode(node), this