From 2c36692052f1f43782ee6f7f3fdf8416b7f7f6c7 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Thu, 19 Jan 2023 16:06:01 +0800 Subject: [PATCH] Use case-insensitve comparator for path --- .../Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index 4a25fe0ad..da6509124 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -31,12 +31,13 @@ namespace Flow.Launcher.Plugin.Explorer.Search public bool Equals(Result x, Result y) { - return x.Title == y.Title && x.SubTitle == y.SubTitle; + return x.Title.Equals(y.Title, StringComparison.OrdinalIgnoreCase) + && string.Equals(x.SubTitle, y.SubTitle, StringComparison.OrdinalIgnoreCase); } public int GetHashCode(Result obj) { - return HashCode.Combine(obj.Title.GetHashCode(), obj.SubTitle?.GetHashCode() ?? 0); + return HashCode.Combine(obj.Title.ToLowerInvariant(), obj.SubTitle?.ToLowerInvariant() ?? ""); } } @@ -118,7 +119,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search { throw new SearchException(engineName, e.Message, e); } - + results.RemoveWhere(r => Settings.IndexSearchExcludedSubdirectoryPaths.Any( excludedPath => IsSubPathOf(r.SubTitle, excludedPath.Path)));