diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
index 79d106ef2..d9cf68469 100644
--- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
+++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
@@ -233,8 +233,8 @@ namespace Flow.Launcher.Plugin
/// Open directory in an explorer configured by user via Flow's Settings. The default is Windows Explorer
///
/// Directory Path to open
- /// Extra FileName Info
- public void OpenDirectory(string DirectoryPath, string FileName = null);
+ /// Extra FileName Info
+ public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null);
///
/// Opens the URL with the given Uri object.
diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs
index b2487693e..ec997f537 100644
--- a/Flow.Launcher/PublicAPIInstance.cs
+++ b/Flow.Launcher/PublicAPIInstance.cs
@@ -1,4 +1,4 @@
- using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
@@ -195,17 +195,20 @@ namespace Flow.Launcher
((PluginJsonStorage)_pluginJsonStorages[type]).Save();
}
- public void OpenDirectory(string DirectoryPath, string FileName = null)
+ public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null)
{
using var explorer = new Process();
var explorerInfo = _settingsVM.Settings.CustomExplorer;
explorer.StartInfo = new ProcessStartInfo
{
FileName = explorerInfo.Path,
- Arguments = FileName is null ?
- explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath) :
- explorerInfo.FileArgument.Replace("%d", DirectoryPath).Replace("%f",
- Path.IsPathRooted(FileName) ? FileName : Path.Combine(DirectoryPath, FileName))
+ Arguments = FileNameOrFilePath is null
+ ? explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath)
+ : explorerInfo.FileArgument
+ .Replace("%d", DirectoryPath)
+ .Replace("%f",
+ Path.IsPathRooted(FileNameOrFilePath) ? FileNameOrFilePath : Path.Combine(DirectoryPath, FileNameOrFilePath)
+ )
};
explorer.Start();
}