1
1
mirror of https://github.com/kahole/edamagit.git synced 2024-09-11 07:15:31 +03:00

adjust visibility of commands in pallette

This commit is contained in:
kahole 2020-03-26 22:05:51 +01:00
parent 98d96e8a30
commit 0e30aa67ab
2 changed files with 29 additions and 14 deletions

View File

@ -37,7 +37,12 @@
"activationEvents": [
"onCommand:magit.status",
"onCommand:magit.dispatch",
"onCommand:magit.file-popup"
"onCommand:magit.commit",
"onCommand:magit.file-popup",
"onCommand:magit.blame-file",
"onCommand:magit.stage-file",
"onCommand:magit.unstage-file",
"onCommand:magit.diff-file"
],
"main": "./out/extension.js",
"contributes": {
@ -46,10 +51,6 @@
"command": "magit.status",
"title": "Magit Status"
},
{
"command": "magit.toggle-fold",
"title": "Magit Toggle Fold"
},
{
"command": "magit.dispatch",
"title": "Magit Dispatch"
@ -193,6 +194,14 @@
],
"menus": {
"commandPalette": [
{
"command": "magit.status",
"when": "activeEditor"
},
{
"command": "magit.dispatch",
"when": "activeEditor"
},
{
"command": "magit.help",
"when": "editorLangId == magit"
@ -286,7 +295,8 @@
"when": "editorLangId == magit"
},
{
"command": "magit.commit"
"command": "magit.commit",
"when": "activeEditor"
},
{
"command": "magit.pushing",
@ -308,21 +318,25 @@
"command": "magit.process-log",
"when": "editorLangId == magit"
},
{
"command": "magit.file-popup",
"when": "activeEditor && editorLangId != magit"
},
{
"command": "magit.blame-file",
"when": "editorLangId != magit"
"when": "activeEditor && editorLangId != magit"
},
{
"command": "magit.diff-file",
"when": "editorLangId != magit"
"when": "activeEditor && editorLangId != magit"
},
{
"command": "magit.stage-file",
"when": "editorLangId != magit"
"when": "activeEditor && editorLangId != magit"
},
{
"command": "magit.unstage-file",
"when": "editorLangId != magit"
"when": "activeEditor && editorLangId != magit"
}
]
},
@ -362,7 +376,8 @@
},
{
"command": "magit.file-popup",
"key": "alt+x alt+g"
"key": "alt+x alt+g",
"when": "activeEditor"
},
{
"command": "magit.toggle-fold",

View File

@ -50,10 +50,10 @@ export default class MagitUtils {
}
}
}
}
if (repository) {
magitRepositories.set(repository.rootUri.fsPath, repository);
if (repository) {
magitRepositories.set(repository.rootUri.fsPath, repository);
}
}
return repository;