mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Make the behavior more like 1.9.5-
This commit is contained in:
parent
9da322f840
commit
42725f289c
1 changed files with 12 additions and 5 deletions
|
|
@ -64,9 +64,9 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
|
||||
IAsyncEnumerable<SearchResult> searchResults;
|
||||
|
||||
bool isPathSearch = query.Search.IsLocationPathString() || query.Search.StartsWith("%");
|
||||
bool isPathSearch = query.Search.IsLocationPathString() || IsEnvironmentVariableSearch(query.Search);
|
||||
|
||||
string EngineName;
|
||||
string engineName;
|
||||
|
||||
switch (isPathSearch)
|
||||
{
|
||||
|
|
@ -86,7 +86,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
return EverythingContentSearchResult(query);
|
||||
|
||||
searchResults = Settings.ContentIndexProvider.ContentSearchAsync("", query.Search, token);
|
||||
EngineName = Enum.GetName(Settings.ContentSearchEngine);
|
||||
engineName = Enum.GetName(Settings.ContentSearchEngine);
|
||||
break;
|
||||
|
||||
case false
|
||||
|
|
@ -94,7 +94,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
|| ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword):
|
||||
|
||||
searchResults = Settings.IndexProvider.SearchAsync(query.Search, token);
|
||||
EngineName = Enum.GetName(Settings.IndexSearchEngine);
|
||||
engineName = Enum.GetName(Settings.IndexSearchEngine);
|
||||
break;
|
||||
default:
|
||||
return results.ToList();
|
||||
|
|
@ -110,7 +110,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
if (e is OperationCanceledException)
|
||||
return results.ToList();
|
||||
|
||||
throw new SearchException(EngineName, e.Message, e);
|
||||
throw new SearchException(engineName, e.Message, e);
|
||||
}
|
||||
|
||||
results.RemoveWhere(r => Settings.IndexSearchExcludedSubdirectoryPaths.Any(
|
||||
|
|
@ -242,5 +242,12 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
x => FilesFolders.ReturnPreviousDirectoryIfIncompleteString(pathToDirectory).StartsWith(x.Path, StringComparison.OrdinalIgnoreCase))
|
||||
&& WindowsIndex.WindowsIndex.PathIsIndexed(pathToDirectory);
|
||||
}
|
||||
|
||||
internal static bool IsEnvironmentVariableSearch(string search)
|
||||
{
|
||||
return search.StartsWith("%")
|
||||
&& search != "%%"
|
||||
&& !search.Contains('\\');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue