I hide the following shortcut for VS Code on MacOS:
{
"key": "cmd 1",
"command": "workbench.scm.focus"
},
What that is focus on the source control pane and show it if the side bar is not visible. What I want now is to to hide the side pane when I click Cmd 1
again and the scm pane is open. Right now I can hide the side pane with Cmd B
:
Is there a way to change that? I have been trying to make a conditional shortcut but I have not found the way.
CodePudding user response:
I'm not sure I understand your flow, but have you looked at the when
clause contexts?
CodePudding user response:
{
"key": "cmd 1",
"command": "workbench.scm.focus",
"when": "!workbench.scm.visible"
},
{
"key": "cmd 1",
"command": "workbench.action.toggleSidebarVisibility",
"when": "workbench.scm.visible"
},