Skip to content

Commit 5aa25e8

Browse files
Merge pull request #1635 from VictoriousRaptor/FixOpenWithEditorSpace
Fix Opening file path containing blanks with editor
2 parents 54ea68c + 85783e7 commit 5aa25e8

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,17 @@ private Result CreateOpenWithEditorResult(SearchResult record)
322322
{
323323
try
324324
{
325-
Process.Start(editorPath, record.FullPath);
325+
Process.Start(new ProcessStartInfo()
326+
{
327+
FileName = editorPath,
328+
ArgumentList = { record.FullPath }
329+
});
326330
return true;
327331
}
328332
catch (Exception e)
329333
{
330-
var message = $"Failed to open editor for file at {record.FullPath} with Editor {Path.GetFileNameWithoutExtension(editorPath)} at {editorPath}";
334+
var raw_message = Context.API.GetTranslation("plugin_explorer_openwitheditor_error");
335+
var message = string.Format(raw_message, record.FullPath, Path.GetFileNameWithoutExtension(editorPath), editorPath);
331336
LogException(message, e);
332337
Context.API.ShowMsgError(message);
333338
return false;
@@ -358,7 +363,8 @@ private Result CreateOpenWithShellResult(SearchResult record)
358363
}
359364
catch (Exception e)
360365
{
361-
var message = $"Failed to open editor for file at {record.FullPath} with Shell {Path.GetFileNameWithoutExtension(shellPath)} at {shellPath}";
366+
var raw_message = Context.API.GetTranslation("plugin_explorer_openwithshell_error");
367+
var message = string.Format(raw_message, record.FullPath, Path.GetFileNameWithoutExtension(shellPath), shellPath);
362368
LogException(message, e);
363369
Context.API.ShowMsgError(message);
364370
return false;

Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@
7171
<system:String x:Key="plugin_explorer_opencontainingfolder">Open containing folder</system:String>
7272
<system:String x:Key="plugin_explorer_opencontainingfolder_subtitle">Opens the location that contains the file or folder</system:String>
7373
<system:String x:Key="plugin_explorer_openwitheditor">Open With Editor:</system:String>
74+
<system:String x:Key="plugin_explorer_openwitheditor_error">Failed to open file at {0} with Editor {1} at {2}</system:String>
7475
<system:String x:Key="plugin_explorer_openwithshell">Open With Shell:</system:String>
76+
<system:String x:Key="plugin_explorer_openwithshell_error">Failed to open folder {0} with Shell {1} at {2}</system:String>
7577
<system:String x:Key="plugin_explorer_excludefromindexsearch">Exclude current and sub-directories from Index Search</system:String>
7678
<system:String x:Key="plugin_explorer_excludedfromindexsearch_msg">Excluded from Index Search</system:String>
7779
<system:String x:Key="plugin_explorer_openindexingoptions">Open Windows Indexing Options</system:String>
@@ -88,7 +90,7 @@
8890
<system:String x:Key="plugin_explorer_remove_from_quickaccess_title">Remove from Quick Access</system:String>
8991
<system:String x:Key="plugin_explorer_remove_from_quickaccess_subtitle">Remove the current {0} from Quick Access</system:String>
9092
<system:String x:Key="plugin_explorer_show_contextmenu_title">Show Windows Context Menu</system:String>
91-
93+
9294
<!-- Everything -->
9395
<system:String x:Key="flowlauncher_plugin_everything_sdk_issue">Everything SDK Loaded Fail</system:String>
9496
<system:String x:Key="flowlauncher_plugin_everything_is_not_running">Warning: Everything service is not running</system:String>

Plugins/Flow.Launcher.Plugin.Explorer/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"Name": "Explorer",
1111
"Description": "Search and manage files and folders. Explorer utilises Windows Index Search",
1212
"Author": "Jeremy Wu",
13-
"Version": "2.0.0",
13+
"Version": "2.0.1",
1414
"Language": "csharp",
1515
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
1616
"ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll",

0 commit comments

Comments
 (0)