From ccdd2a6dbe5b1144e7e92ac777d9caf7988108db Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 31 Aug 2020 01:18:26 -0400 Subject: [PATCH] Updates set views layout command --- src/commands/setViewsLayout.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/commands/setViewsLayout.ts b/src/commands/setViewsLayout.ts index bb02ddd..e2cfcdd 100644 --- a/src/commands/setViewsLayout.ts +++ b/src/commands/setViewsLayout.ts @@ -60,8 +60,15 @@ export class SetViewsLayoutCommand extends Command { break; case ViewsLayout.SourceControl: - for (const view of viewsConfigKeys) { - void (await commands.executeCommand(`${extensionId}.views.${view}.resetViewLocation`)); + try { + void (await commands.executeCommand( + 'workbench.action.moveViews', + viewsConfigKeys.map(view => `${extensionId}.views.${view}`, 'workbench.view.scm'), + )); + } catch { + for (const view of viewsConfigKeys) { + void (await commands.executeCommand(`${extensionId}.views.${view}.resetViewLocation`)); + } } break;