mirror of
https://github.com/kahole/edamagit.git
synced 2024-09-11 07:15:31 +03:00
Allows magit.dispatch from anywhere (#56)
* allows magit.dispatch from anywhere * remove the when clause of magit.status and magit.dispatch
This commit is contained in:
parent
1d1760a316
commit
3476269367
@ -195,12 +195,10 @@
|
||||
"menus": {
|
||||
"commandPalette": [
|
||||
{
|
||||
"command": "magit.status",
|
||||
"when": "activeEditor"
|
||||
"command": "magit.status"
|
||||
},
|
||||
{
|
||||
"command": "magit.dispatch",
|
||||
"when": "activeEditor"
|
||||
"command": "magit.dispatch"
|
||||
},
|
||||
{
|
||||
"command": "magit.help",
|
||||
|
@ -120,11 +120,16 @@ export function activate(context: ExtensionContext) {
|
||||
context.subscriptions.push(commands.registerTextEditorCommand('magit.stage-file', Command.primeFileCommand(stageFile)));
|
||||
context.subscriptions.push(commands.registerTextEditorCommand('magit.unstage-file', Command.primeFileCommand(unstageFile)));
|
||||
|
||||
context.subscriptions.push(commands.registerTextEditorCommand('magit.dispatch', Command.primeRepo(async (repository: MagitRepository) => {
|
||||
const uri = DispatchView.encodeLocation(repository);
|
||||
views.set(uri.toString(), new DispatchView(uri));
|
||||
return workspace.openTextDocument(uri).then(doc => window.showTextDocument(doc, { viewColumn: MagitUtils.showDocumentColumn(), preview: false }));
|
||||
}, false)));
|
||||
context.subscriptions.push(commands.registerCommand('magit.dispatch', async () => {
|
||||
const editor = window.activeTextEditor;
|
||||
const repository = await MagitUtils.getCurrentMagitRepo(editor?.document.uri);
|
||||
|
||||
if (repository) {
|
||||
const uri = DispatchView.encodeLocation(repository);
|
||||
views.set(uri.toString(), new DispatchView(uri));
|
||||
return workspace.openTextDocument(uri).then(doc => window.showTextDocument(doc, { viewColumn: MagitUtils.showDocumentColumn(), preview: false }));
|
||||
}
|
||||
}));
|
||||
|
||||
context.subscriptions.push(commands.registerTextEditorCommand('magit.toggle-fold', Command.primeRepoAndView(async (repo: MagitRepository, view: DocumentView) => {
|
||||
const selectedView = view.click(window.activeTextEditor!.selection.active);
|
||||
|
Loading…
Reference in New Issue
Block a user