Skip to content

Commit 4b78926

Browse files
committed
use actual path variable consistently throughout path search
1 parent 67ae8e5 commit 4b78926

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo;
1+
using Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo;
22
using Flow.Launcher.Plugin.Explorer.Search.Everything;
33
using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks;
44
using Flow.Launcher.Plugin.SharedCommands;
@@ -180,16 +180,16 @@ private async Task<List<Result>> PathSearchAsync(Query query, CancellationToken
180180

181181
// Query is a location path with a full environment variable, eg. %appdata%\somefolder\, c:\users\%USERNAME%\downloads
182182
var needToExpand = EnvironmentVariables.HasEnvironmentVar(querySearch);
183-
var locationPath = needToExpand ? Environment.ExpandEnvironmentVariables(querySearch) : querySearch;
183+
var path = needToExpand ? Environment.ExpandEnvironmentVariables(querySearch) : querySearch;
184184

185185
// Check that actual location exists, otherwise directory search will throw directory not found exception
186-
if (!FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath).LocationExists())
186+
if (!FilesFolders.ReturnPreviousDirectoryIfIncompleteString(path).LocationExists())
187187
return results.ToList();
188188

189189
var useIndexSearch = Settings.IndexSearchEngine is Settings.IndexSearchEngineOption.WindowsIndex
190-
&& UseWindowsIndexForDirectorySearch(locationPath);
190+
&& UseWindowsIndexForDirectorySearch(path);
191191

192-
var retrievedDirectoryPath = FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath);
192+
var retrievedDirectoryPath = FilesFolders.ReturnPreviousDirectoryIfIncompleteString(path);
193193

194194
results.Add(retrievedDirectoryPath.EndsWith(":\\")
195195
? ResultManager.CreateDriveSpaceDisplayResult(retrievedDirectoryPath, query.ActionKeyword, useIndexSearch)
@@ -200,21 +200,21 @@ private async Task<List<Result>> PathSearchAsync(Query query, CancellationToken
200200

201201
IAsyncEnumerable<SearchResult> directoryResult;
202202

203-
var recursiveIndicatorIndex = query.Search.IndexOf('>');
203+
var recursiveIndicatorIndex = path.IndexOf('>');
204204

205205
if (recursiveIndicatorIndex > 0 && Settings.PathEnumerationEngine != Settings.PathEnumerationEngineOption.DirectEnumeration)
206206
{
207207
directoryResult =
208208
Settings.PathEnumerator.EnumerateAsync(
209-
query.Search[..recursiveIndicatorIndex].Trim(),
210-
query.Search[(recursiveIndicatorIndex + 1)..],
209+
path[..recursiveIndicatorIndex].Trim(),
210+
path[(recursiveIndicatorIndex + 1)..],
211211
true,
212212
token);
213213

214214
}
215215
else
216216
{
217-
directoryResult = DirectoryInfoSearch.TopLevelDirectorySearch(query, query.Search, token).ToAsyncEnumerable();
217+
directoryResult = DirectoryInfoSearch.TopLevelDirectorySearch(query, path, token).ToAsyncEnumerable();
218218
}
219219

220220
if (token.IsCancellationRequested)

0 commit comments

Comments
 (0)