Browse Source

Reworks close view command

main
Eric Amodio 4 years ago
parent
commit
673110f56c
4 changed files with 38 additions and 15 deletions
  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 View File

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

+ 1
- 1
src/commands.ts View File

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

+ 22
- 0
src/commands/closeView.ts View File

@ -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 View File

@ -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));
}
}

Loading…
Cancel
Save