diff --git a/package.json b/package.json index 3f171f1..cb89a08 100644 --- a/package.json +++ b/package.json @@ -5044,6 +5044,11 @@ "category": "GitLens" }, { + "command": "gitlens.resetViewsLayout", + "title": "Reset Views Layout", + "category": "GitLens" + }, + { "command": "gitlens.setViewsLayout", "title": "Set Views Layout", "category": "GitLens" diff --git a/src/commands/setViewsLayout.ts b/src/commands/setViewsLayout.ts index 5e754c1..3bc792a 100644 --- a/src/commands/setViewsLayout.ts +++ b/src/commands/setViewsLayout.ts @@ -5,6 +5,19 @@ import type { Container } from '../container'; import { command, executeCommand, executeCoreCommand } from '../system/command'; import { Command } from './base'; +@command() +export class ResetViewsLayoutCommand extends Command { + constructor(private readonly container: Container) { + super(Commands.ResetViewsLayout); + } + + async execute() { + for (const view of viewsConfigKeys) { + void (await executeCommand(`gitlens.views.${view}.resetViewLocation`)); + } + } +} + export enum ViewsLayout { GitLens = 'gitlens', SourceControl = 'scm', diff --git a/src/constants.ts b/src/constants.ts index 43729e5..b089fae 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -223,6 +223,7 @@ export const enum Commands { ResetOpenAIKey = 'gitlens.resetOpenAIKey', ResetSuppressedWarnings = 'gitlens.resetSuppressedWarnings', ResetTrackedUsage = 'gitlens.resetTrackedUsage', + ResetViewsLayout = 'gitlens.resetViewsLayout', RevealCommitInView = 'gitlens.revealCommitInView', SearchCommits = 'gitlens.showCommitSearch', SearchCommitsInView = 'gitlens.views.searchAndCompare.searchCommits',