What's wrong
ThemeRegistry.ThemesByFamily is built with ToDictionary using the default, case-sensitive string comparer (ThemeProvider/ThemeRegistry.cs:106-109). GetThemesInFamily (:146-152) and CreateThemeInstancesInFamily look families up in that dictionary.
Meanwhile, FindTheme is documented and implemented as case-insensitive. So at 9454d42:
GetThemesInFamily("Catppuccin").Count is 4.
GetThemesInFamily("catppuccin").Count is 0.
FindTheme("catppuccin mocha") finds the theme.
GetThemesInFamily(null!) throws ArgumentNullException from the dictionary, while FindTheme(null!) returns null.
Why it matters
A theme picker or config file that stores family names in a different case, such as lower-cased keys from a settings file or a CLI argument, gets an empty family back. Nothing reports an error, and the behaviour contradicts the registry's name lookup.
Suggested fix
- Pass
StringComparer.OrdinalIgnoreCase to the ToDictionary call.
- Handle a null
family the same way FindTheme handles a null name.
Acceptance criteria
GetThemesInFamily("catppuccin") and CreateThemeInstancesInFamily("CATPPUCCIN") return the four Catppuccin themes.
- Null handling matches
FindTheme.
- A test covers the lower-case family lookup.
What's wrong
ThemeRegistry.ThemesByFamilyis built withToDictionaryusing the default, case-sensitive string comparer (ThemeProvider/ThemeRegistry.cs:106-109).GetThemesInFamily(:146-152) andCreateThemeInstancesInFamilylook families up in that dictionary.Meanwhile,
FindThemeis documented and implemented as case-insensitive. So at9454d42:GetThemesInFamily("Catppuccin").Countis 4.GetThemesInFamily("catppuccin").Countis 0.FindTheme("catppuccin mocha")finds the theme.GetThemesInFamily(null!)throwsArgumentNullExceptionfrom the dictionary, whileFindTheme(null!)returns null.Why it matters
A theme picker or config file that stores family names in a different case, such as lower-cased keys from a settings file or a CLI argument, gets an empty family back. Nothing reports an error, and the behaviour contradicts the registry's name lookup.
Suggested fix
StringComparer.OrdinalIgnoreCaseto theToDictionarycall.familythe same wayFindThemehandles a null name.Acceptance criteria
GetThemesInFamily("catppuccin")andCreateThemeInstancesInFamily("CATPPUCCIN")return the four Catppuccin themes.FindTheme.