Fix unix directory seperator issue

This commit is contained in:
Jack251970 2025-02-07 16:05:35 +08:00
parent 38eb07afef
commit a3cc5e25f9
2 changed files with 6 additions and 1 deletions

View file

@ -31,6 +31,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search
internal const string DefaultContentSearchActionKeyword = "doc:";
internal const char UnixDirectorySeparator = '/';
internal const char DirectorySeparator = '\\';
internal const string WindowsIndexingOptions = "srchadmin.dll";

View file

@ -1,4 +1,4 @@
using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Plugin.SharedCommands;
using System;
using System.Collections.Generic;
@ -12,6 +12,9 @@ namespace Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo
{
internal static IEnumerable<SearchResult> TopLevelDirectorySearch(Query query, string search, CancellationToken token)
{
// if user uses the unix directory separator, we need to convert it to windows directory separator
search = search.Replace(Constants.UnixDirectorySeparator, Constants.DirectorySeparator);
var criteria = ConstructSearchCriteria(search);
if (search.LastIndexOf(Constants.AllFilesFolderSearchWildcard) >