Skip to content

Commit a4ca486

Browse files
committed
formatting
1 parent 0e555b5 commit a4ca486

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

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

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,36 +69,35 @@ internal async Task<List<Result>> SearchAsync(Query query, CancellationToken tok
6969
switch (isPathSearch)
7070
{
7171
case true
72-
when (ActionKeywordMatch(query, Settings.ActionKeyword.PathSearchActionKeyword)
73-
|| ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword)):
72+
when ActionKeywordMatch(query, Settings.ActionKeyword.PathSearchActionKeyword)
73+
|| ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword):
74+
7475
results.UnionWith(await PathSearchAsync(query, token).ConfigureAwait(false));
76+
7577
return results.ToList();
76-
break;
77-
case false when ActionKeywordMatch(query, Settings.ActionKeyword.FileContentSearchActionKeyword):
78-
{
79-
// A backdoor to prevent everything to do content search
78+
79+
case false
80+
when ActionKeywordMatch(query, Settings.ActionKeyword.FileContentSearchActionKeyword):
81+
82+
// Intentionally require enabling of Everything's content search due to its slowness
8083
if (Settings.ContentIndexProvider is EverythingSearchManager && !Settings.EnableEverythingContentSearch)
81-
{
8284
return EverythingContentSearchResult(query);
83-
}
85+
8486
searchResults = Settings.ContentIndexProvider.ContentSearchAsync("", query.Search, token);
87+
8588
break;
86-
}
89+
8790
case false:
8891
searchResults = Settings.IndexProvider.SearchAsync(query.Search, token);
92+
8993
break;
9094
}
9195

92-
9396
if (searchResults == null)
94-
{
9597
return results.ToList();
96-
}
9798

9899
await foreach (var search in searchResults.WithCancellation(token).ConfigureAwait(false))
99-
{
100100
results.Add(ResultManager.CreateResult(query, search));
101-
}
102101

103102
results.RemoveWhere(r => Settings.IndexSearchExcludedSubdirectoryPaths.Any(
104103
excludedPath => r.SubTitle.StartsWith(excludedPath.Path, StringComparison.OrdinalIgnoreCase)));

0 commit comments

Comments
 (0)