Procházet zdrojové kódy

Adds reset views location command

main
Eric Amodio před 1 rokem
rodič
revize
cb7b23de8b
3 změnil soubory, kde provedl 19 přidání a 0 odebrání
  1. +5
    -0
      package.json
  2. +13
    -0
      src/commands/setViewsLayout.ts
  3. +1
    -0
      src/constants.ts

+ 5
- 0
package.json Zobrazit soubor

@ -5044,6 +5044,11 @@
"category": "GitLens" "category": "GitLens"
}, },
{ {
"command": "gitlens.resetViewsLayout",
"title": "Reset Views Layout",
"category": "GitLens"
},
{
"command": "gitlens.setViewsLayout", "command": "gitlens.setViewsLayout",
"title": "Set Views Layout", "title": "Set Views Layout",
"category": "GitLens" "category": "GitLens"

+ 13
- 0
src/commands/setViewsLayout.ts Zobrazit soubor

@ -5,6 +5,19 @@ import type { Container } from '../container';
import { command, executeCommand, executeCoreCommand } from '../system/command'; import { command, executeCommand, executeCoreCommand } from '../system/command';
import { Command } from './base'; 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 { export enum ViewsLayout {
GitLens = 'gitlens', GitLens = 'gitlens',
SourceControl = 'scm', SourceControl = 'scm',

+ 1
- 0
src/constants.ts Zobrazit soubor

@ -223,6 +223,7 @@ export const enum Commands {
ResetOpenAIKey = 'gitlens.resetOpenAIKey', ResetOpenAIKey = 'gitlens.resetOpenAIKey',
ResetSuppressedWarnings = 'gitlens.resetSuppressedWarnings', ResetSuppressedWarnings = 'gitlens.resetSuppressedWarnings',
ResetTrackedUsage = 'gitlens.resetTrackedUsage', ResetTrackedUsage = 'gitlens.resetTrackedUsage',
ResetViewsLayout = 'gitlens.resetViewsLayout',
RevealCommitInView = 'gitlens.revealCommitInView', RevealCommitInView = 'gitlens.revealCommitInView',
SearchCommits = 'gitlens.showCommitSearch', SearchCommits = 'gitlens.showCommitSearch',
SearchCommitsInView = 'gitlens.views.searchAndCompare.searchCommits', SearchCommitsInView = 'gitlens.views.searchAndCompare.searchCommits',

Načítá se…
Zrušit
Uložit