Skip to content

Commit 3d06ade

Browse files
committed
Customize select funtionality in win32 except globally in program, and make code more readable
1 parent ead4c9a commit 3d06ade

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,19 @@ public List<Result> ContextMenus(IPublicAPI api)
140140
Title = api.GetTranslation("flowlauncher_plugin_program_open_containing_folder"),
141141
Action = _ =>
142142
{
143+
var args = !string.IsNullOrWhiteSpace(Main._settings.CustomizedArgs)
144+
?Main._settings.CustomizedArgs
145+
.Replace("%s",$"\"{ParentDirectory}\"")
146+
.Replace("%f",$"\"{FullPath}\""):
147+
Main._settings.CustomizedExplorer==Settings.Explorer
148+
? $"/select,\"{FullPath}\""
149+
: Settings.ExplorerArgs;
150+
143151
Main.StartProcess(Process.Start, new ProcessStartInfo(
144-
!string.IsNullOrWhiteSpace(Main._settings.CustomizedExplorer) ? Main._settings.CustomizedExplorer:Settings.Explorer,
145-
!string.IsNullOrWhiteSpace(Main._settings.CustomizedArgs)?Main._settings.CustomizedArgs.Replace("%s",$"\"{ParentDirectory}\"").Replace("%f",$"\"{FullPath}\""):
146-
Settings.ExplorerArgs));
152+
!string.IsNullOrWhiteSpace(Main._settings.CustomizedExplorer)
153+
? Main._settings.CustomizedExplorer
154+
: Settings.Explorer,
155+
args));
147156
return true;
148157
},
149158
IcoPath = "Images/folder.png"

Plugins/Flow.Launcher.Plugin.Program/Settings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class Settings
2121

2222
internal const string Explorer = "explorer";
2323

24-
internal const string ExplorerArgs = "/select,%f";
24+
internal const string ExplorerArgs = "%s";
2525

2626
/// <summary>
2727
/// Contains user added folder location contents as well as all user disabled applications

0 commit comments

Comments
 (0)