mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
use actual path variable consistently throughout path search
This commit is contained in:
parent
67ae8e579e
commit
4b78926a77
1 changed files with 9 additions and 9 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo;
|
||||
using Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo;
|
||||
using Flow.Launcher.Plugin.Explorer.Search.Everything;
|
||||
using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks;
|
||||
using Flow.Launcher.Plugin.SharedCommands;
|
||||
|
|
@ -180,16 +180,16 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
|
||||
// Query is a location path with a full environment variable, eg. %appdata%\somefolder\, c:\users\%USERNAME%\downloads
|
||||
var needToExpand = EnvironmentVariables.HasEnvironmentVar(querySearch);
|
||||
var locationPath = needToExpand ? Environment.ExpandEnvironmentVariables(querySearch) : querySearch;
|
||||
var path = needToExpand ? Environment.ExpandEnvironmentVariables(querySearch) : querySearch;
|
||||
|
||||
// Check that actual location exists, otherwise directory search will throw directory not found exception
|
||||
if (!FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath).LocationExists())
|
||||
if (!FilesFolders.ReturnPreviousDirectoryIfIncompleteString(path).LocationExists())
|
||||
return results.ToList();
|
||||
|
||||
var useIndexSearch = Settings.IndexSearchEngine is Settings.IndexSearchEngineOption.WindowsIndex
|
||||
&& UseWindowsIndexForDirectorySearch(locationPath);
|
||||
&& UseWindowsIndexForDirectorySearch(path);
|
||||
|
||||
var retrievedDirectoryPath = FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath);
|
||||
var retrievedDirectoryPath = FilesFolders.ReturnPreviousDirectoryIfIncompleteString(path);
|
||||
|
||||
results.Add(retrievedDirectoryPath.EndsWith(":\\")
|
||||
? ResultManager.CreateDriveSpaceDisplayResult(retrievedDirectoryPath, query.ActionKeyword, useIndexSearch)
|
||||
|
|
@ -200,21 +200,21 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
|
||||
IAsyncEnumerable<SearchResult> directoryResult;
|
||||
|
||||
var recursiveIndicatorIndex = query.Search.IndexOf('>');
|
||||
var recursiveIndicatorIndex = path.IndexOf('>');
|
||||
|
||||
if (recursiveIndicatorIndex > 0 && Settings.PathEnumerationEngine != Settings.PathEnumerationEngineOption.DirectEnumeration)
|
||||
{
|
||||
directoryResult =
|
||||
Settings.PathEnumerator.EnumerateAsync(
|
||||
query.Search[..recursiveIndicatorIndex].Trim(),
|
||||
query.Search[(recursiveIndicatorIndex + 1)..],
|
||||
path[..recursiveIndicatorIndex].Trim(),
|
||||
path[(recursiveIndicatorIndex + 1)..],
|
||||
true,
|
||||
token);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
directoryResult = DirectoryInfoSearch.TopLevelDirectorySearch(query, query.Search, token).ToAsyncEnumerable();
|
||||
directoryResult = DirectoryInfoSearch.TopLevelDirectorySearch(query, path, token).ToAsyncEnumerable();
|
||||
}
|
||||
|
||||
if (token.IsCancellationRequested)
|
||||
|
|
|
|||
Loading…
Reference in a new issue