mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
formatting
This commit is contained in:
parent
0e555b5224
commit
a4ca486a6c
1 changed files with 13 additions and 14 deletions
|
|
@ -69,36 +69,35 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
||||||
switch (isPathSearch)
|
switch (isPathSearch)
|
||||||
{
|
{
|
||||||
case true
|
case true
|
||||||
when (ActionKeywordMatch(query, Settings.ActionKeyword.PathSearchActionKeyword)
|
when ActionKeywordMatch(query, Settings.ActionKeyword.PathSearchActionKeyword)
|
||||||
|| ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword)):
|
|| ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword):
|
||||||
|
|
||||||
results.UnionWith(await PathSearchAsync(query, token).ConfigureAwait(false));
|
results.UnionWith(await PathSearchAsync(query, token).ConfigureAwait(false));
|
||||||
|
|
||||||
return results.ToList();
|
return results.ToList();
|
||||||
break;
|
|
||||||
case false when ActionKeywordMatch(query, Settings.ActionKeyword.FileContentSearchActionKeyword):
|
case false
|
||||||
{
|
when ActionKeywordMatch(query, Settings.ActionKeyword.FileContentSearchActionKeyword):
|
||||||
// A backdoor to prevent everything to do content search
|
|
||||||
|
// Intentionally require enabling of Everything's content search due to its slowness
|
||||||
if (Settings.ContentIndexProvider is EverythingSearchManager && !Settings.EnableEverythingContentSearch)
|
if (Settings.ContentIndexProvider is EverythingSearchManager && !Settings.EnableEverythingContentSearch)
|
||||||
{
|
|
||||||
return EverythingContentSearchResult(query);
|
return EverythingContentSearchResult(query);
|
||||||
}
|
|
||||||
searchResults = Settings.ContentIndexProvider.ContentSearchAsync("", query.Search, token);
|
searchResults = Settings.ContentIndexProvider.ContentSearchAsync("", query.Search, token);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case false:
|
case false:
|
||||||
searchResults = Settings.IndexProvider.SearchAsync(query.Search, token);
|
searchResults = Settings.IndexProvider.SearchAsync(query.Search, token);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (searchResults == null)
|
if (searchResults == null)
|
||||||
{
|
|
||||||
return results.ToList();
|
return results.ToList();
|
||||||
}
|
|
||||||
|
|
||||||
await foreach (var search in searchResults.WithCancellation(token).ConfigureAwait(false))
|
await foreach (var search in searchResults.WithCancellation(token).ConfigureAwait(false))
|
||||||
{
|
|
||||||
results.Add(ResultManager.CreateResult(query, search));
|
results.Add(ResultManager.CreateResult(query, search));
|
||||||
}
|
|
||||||
|
|
||||||
results.RemoveWhere(r => Settings.IndexSearchExcludedSubdirectoryPaths.Any(
|
results.RemoveWhere(r => Settings.IndexSearchExcludedSubdirectoryPaths.Any(
|
||||||
excludedPath => r.SubTitle.StartsWith(excludedPath.Path, StringComparison.OrdinalIgnoreCase)));
|
excludedPath => r.SubTitle.StartsWith(excludedPath.Path, StringComparison.OrdinalIgnoreCase)));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue