mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Fix negative matching on folders with no matches.
This commit is contained in:
parent
cec28a1823
commit
1501bd4fbf
1 changed files with 5 additions and 5 deletions
|
|
@ -95,9 +95,9 @@ public sealed class ModSearchStringSplitter : SearchStringSplitter<ModSearchType
|
|||
}
|
||||
|
||||
var fullName = folder.FullName();
|
||||
return Forced.All(i => MatchesName(i, folder.Name, fullName))
|
||||
&& !Negated.Any(i => MatchesName(i, folder.Name, fullName))
|
||||
&& (General.Count == 0 || General.Any(i => MatchesName(i, folder.Name, fullName)));
|
||||
return Forced.All(i => MatchesName(i, folder.Name, fullName, false))
|
||||
&& !Negated.Any(i => MatchesName(i, folder.Name, fullName, true))
|
||||
&& (General.Count == 0 || General.Any(i => MatchesName(i, folder.Name, fullName, false)));
|
||||
}
|
||||
|
||||
protected override bool Matches(Entry entry, ModFileSystem.Leaf leaf)
|
||||
|
|
@ -128,11 +128,11 @@ public sealed class ModSearchStringSplitter : SearchStringSplitter<ModSearchType
|
|||
_ => true,
|
||||
};
|
||||
|
||||
private static bool MatchesName(Entry entry, ReadOnlySpan<char> name, ReadOnlySpan<char> fullName)
|
||||
private static bool MatchesName(Entry entry, ReadOnlySpan<char> name, ReadOnlySpan<char> fullName, bool defaultValue)
|
||||
=> entry.Type switch
|
||||
{
|
||||
ModSearchType.Default => fullName.Contains(entry.Needle, StringComparison.OrdinalIgnoreCase),
|
||||
ModSearchType.Name => name.Contains(entry.Needle, StringComparison.OrdinalIgnoreCase),
|
||||
_ => false,
|
||||
_ => defaultValue,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue