From 44b25b487a2db3b986dc14bb81e859a950e84688 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sun, 15 Jun 2025 12:29:05 +0800 Subject: [PATCH] Prefer injected Context over static Main.Context --- Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index c83f74b5b..9c0956197 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -347,8 +347,6 @@ namespace Flow.Launcher.Plugin.Explorer }; } - - private Result CreateOpenWithEditorResult(SearchResult record, string editorPath) { var name = $"{Context.API.GetTranslation("plugin_explorer_openwitheditor")} {Path.GetFileNameWithoutExtension(editorPath)}"; @@ -360,7 +358,7 @@ namespace Flow.Launcher.Plugin.Explorer { try { - Main.Context.API.StartProcess(editorPath, arguments: record.FullPath); + Context.API.StartProcess(editorPath, arguments: record.FullPath); return true; } catch (Exception e) @@ -390,7 +388,7 @@ namespace Flow.Launcher.Plugin.Explorer { try { - Main.Context.API.StartProcess(shellPath, workingDirectory: record.FullPath, arguments: string.Empty); + Context.API.StartProcess(shellPath, workingDirectory: record.FullPath, arguments: string.Empty); return true; } catch (Exception e)