Skip to content

Commit 2c36692

Browse files
Use case-insensitve comparator for path
1 parent a6b7c58 commit 2c36692

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ private class PathEqualityComparator : IEqualityComparer<Result>
3131

3232
public bool Equals(Result x, Result y)
3333
{
34-
return x.Title == y.Title && x.SubTitle == y.SubTitle;
34+
return x.Title.Equals(y.Title, StringComparison.OrdinalIgnoreCase)
35+
&& string.Equals(x.SubTitle, y.SubTitle, StringComparison.OrdinalIgnoreCase);
3536
}
3637

3738
public int GetHashCode(Result obj)
3839
{
39-
return HashCode.Combine(obj.Title.GetHashCode(), obj.SubTitle?.GetHashCode() ?? 0);
40+
return HashCode.Combine(obj.Title.ToLowerInvariant(), obj.SubTitle?.ToLowerInvariant() ?? "");
4041
}
4142
}
4243

@@ -118,7 +119,7 @@ when ActionKeywordMatch(query, Settings.ActionKeyword.IndexSearchActionKeyword)
118119
{
119120
throw new SearchException(engineName, e.Message, e);
120121
}
121-
122+
122123
results.RemoveWhere(r => Settings.IndexSearchExcludedSubdirectoryPaths.Any(
123124
excludedPath => IsSubPathOf(r.SubTitle, excludedPath.Path)));
124125

0 commit comments

Comments
 (0)