Skip to content

Commit 44b25b4

Browse files
committed
Prefer injected Context over static Main.Context
1 parent 39de484 commit 44b25b4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,6 @@ private Result CreateOpenContainingFolderResult(SearchResult record)
347347
};
348348
}
349349

350-
351-
352350
private Result CreateOpenWithEditorResult(SearchResult record, string editorPath)
353351
{
354352
var name = $"{Context.API.GetTranslation("plugin_explorer_openwitheditor")} {Path.GetFileNameWithoutExtension(editorPath)}";
@@ -360,7 +358,7 @@ private Result CreateOpenWithEditorResult(SearchResult record, string editorPath
360358
{
361359
try
362360
{
363-
Main.Context.API.StartProcess(editorPath, arguments: record.FullPath);
361+
Context.API.StartProcess(editorPath, arguments: record.FullPath);
364362
return true;
365363
}
366364
catch (Exception e)
@@ -390,7 +388,7 @@ private Result CreateOpenWithShellResult(SearchResult record)
390388
{
391389
try
392390
{
393-
Main.Context.API.StartProcess(shellPath, workingDirectory: record.FullPath, arguments: string.Empty);
391+
Context.API.StartProcess(shellPath, workingDirectory: record.FullPath, arguments: string.Empty);
394392
return true;
395393
}
396394
catch (Exception e)

0 commit comments

Comments
 (0)