Browse Source

Adds Collapse command to view nodes

main
Eric Amodio 1 year ago
parent
commit
84e197baab
3 changed files with 17 additions and 1 deletions
  1. +15
    -1
      package.json
  2. +1
    -0
      src/constants.ts
  3. +1
    -0
      src/views/viewCommands.ts

+ 15
- 1
package.json View File

@ -6525,6 +6525,11 @@
"icon": "$(close)" "icon": "$(close)"
}, },
{ {
"command": "gitlens.views.collapseNode",
"title": "Collapse",
"category": "GitLens"
},
{
"command": "gitlens.views.dismissNode", "command": "gitlens.views.dismissNode",
"title": "Dismiss", "title": "Dismiss",
"category": "GitLens", "category": "GitLens",
@ -9385,6 +9390,10 @@
"when": "false" "when": "false"
}, },
{ {
"command": "gitlens.views.collapseNode",
"when": "false"
},
{
"command": "gitlens.views.dismissNode", "command": "gitlens.views.dismissNode",
"when": "false" "when": "false"
}, },
@ -13081,11 +13090,16 @@
"group": "8_gitlens_actions@98" "group": "8_gitlens_actions@98"
}, },
{ {
"command": "gitlens.views.expandNode",
"command": "gitlens.views.collapseNode",
"when": "viewItem =~ /gitlens:(branch|compare|folder|results|search|status)\\b/", "when": "viewItem =~ /gitlens:(branch|compare|folder|results|search|status)\\b/",
"group": "9_gitlens@1" "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", "command": "gitlens.views.refreshNode",
"when": "viewItem =~ /gitlens:(?!(file|message|date-marker)\\b)/", "when": "viewItem =~ /gitlens:(?!(file|message|date-marker)\\b)/",
"group": "9_gitlens@99" "group": "9_gitlens@99"

+ 1
- 0
src/constants.ts View File

@ -606,6 +606,7 @@ export type CoreCommands =
| 'editor.action.showReferences' | 'editor.action.showReferences'
| 'editor.action.webvieweditor.showFind' | 'editor.action.webvieweditor.showFind'
| 'editorScroll' | 'editorScroll'
| 'list.collapseAllToFocus'
| 'openInTerminal' | 'openInTerminal'
| 'revealFileInOS' | 'revealFileInOS'
| 'revealInExplorer' | 'revealInExplorer'

+ 1
- 0
src/views/viewCommands.ts View File

@ -136,6 +136,7 @@ export class ViewCommands {
}, },
this, this,
); );
registerViewCommand('gitlens.views.collapseNode', () => executeCoreCommand('list.collapseAllToFocus'), this);
registerViewCommand( registerViewCommand(
'gitlens.views.dismissNode', 'gitlens.views.dismissNode',
(n: ViewNode) => canViewDismissNode(n.view) && n.view.dismissNode(n), (n: ViewNode) => canViewDismissNode(n.view) && n.view.dismissNode(n),

Loading…
Cancel
Save