Переглянути джерело

Reworks close view command

main
Eric Amodio 4 роки тому
джерело
коміт
673110f56c
4 змінених файлів з 38 додано та 15 видалено
  1. +15
    -0
      package.json
  2. +1
    -1
      src/commands.ts
  3. +22
    -0
      src/commands/closeView.ts
  4. +0
    -14
      src/commands/closeWelcomeView.ts

+ 15
- 0
package.json Переглянути файл

@ -2531,6 +2531,12 @@
"category": "GitLens"
},
{
"command": "gitlens.closeWelcomeView",
"title": "Close",
"category": "GitLens",
"icon": "$(close)"
},
{
"command": "gitlens.diffDirectory",
"title": "Directory Compare Working Tree with...",
"category": "GitLens"
@ -4328,6 +4334,10 @@
"when": "gitlens:enabled"
},
{
"command": "gitlens.closeWelcomeView",
"when": "false"
},
{
"command": "gitlens.diffDirectory",
"when": "gitlens:enabled"
},
@ -5802,6 +5812,11 @@
],
"view/title": [
{
"command": "gitlens.closeWelcomeView",
"when": "view == gitlens.views.welcome",
"group": "navigation@1"
},
{
"command": "gitlens.pushRepositories",
"when": "gitlens:hasRemotes && !gitlens:readonly && view =~ /^gitlens\\.views\\.(repositories|commits)/",
"group": "navigation@1"

+ 1
- 1
src/commands.ts Переглянути файл

@ -3,7 +3,7 @@
export * from './commands/addAuthors';
export * from './commands/browseRepoAtRevision';
export * from './commands/closeUnchangedFiles';
export * from './commands/closeWelcomeView';
export * from './commands/closeView';
export * from './commands/common';
export * from './commands/copyMessageToClipboard';
export * from './commands/copyShaToClipboard';

+ 22
- 0
src/commands/closeView.ts Переглянути файл

@ -0,0 +1,22 @@
'use strict';
import { configuration } from '../configuration';
import { command, Command, CommandContext, Commands } from './common';
@command()
export class CloseViewCommand extends Command {
constructor() {
super(Commands.CloseWelcomeView);
}
protected preExecute(context: CommandContext) {
return this.execute(context.command as Commands);
}
async execute(command: Commands) {
switch (command) {
case Commands.CloseWelcomeView:
void (await configuration.updateEffective('views', 'welcome', 'enabled', false));
break;
}
}
}

+ 0
- 14
src/commands/closeWelcomeView.ts Переглянути файл

@ -1,14 +0,0 @@
'use strict';
import { configuration } from '../configuration';
import { command, Command, Commands } from './common';
@command()
export class CloseWelcomeViewCommand extends Command {
constructor() {
super(Commands.CloseWelcomeView);
}
async execute() {
void (await configuration.updateEffective('views', 'welcome', 'enabled', false));
}
}

Завантаження…
Відмінити
Зберегти