Skip to content

Fix unix directory seperator issue #3231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ internal static class Constants
internal const string WindowsIndexErrorImagePath = "Images\\index_error2.png";
internal const string GeneralSearchErrorImagePath = "Images\\robot_error.png";


internal const string ToolTipOpenDirectory = "Ctrl + Enter to open the directory";

internal const string ToolTipOpenContainingFolder = "Ctrl + Enter to open the containing folder";
Expand All @@ -31,6 +30,8 @@ internal static class Constants

internal const string DefaultContentSearchActionKeyword = "doc:";

internal const char UnixDirectorySeparator = '/';

internal const char DirectorySeparator = '\\';

internal const string WindowsIndexingOptions = "srchadmin.dll";
Expand Down
3 changes: 3 additions & 0 deletions Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ private async Task<List<Result>> PathSearchAsync(Query query, CancellationToken
var needToExpand = EnvironmentVariables.HasEnvironmentVar(querySearch);
var path = needToExpand ? Environment.ExpandEnvironmentVariables(querySearch) : querySearch;

// if user uses the unix directory separator, we need to convert it to windows directory separator
path = path.Replace(Constants.UnixDirectorySeparator, Constants.DirectorySeparator);

// Check that actual location exists, otherwise directory search will throw directory not found exception
if (!FilesFolders.ReturnPreviousDirectoryIfIncompleteString(path).LocationExists())
return results.ToList();
Expand Down
Loading