hyprlang/tests
John Mylchreest 0567ba7607
core/parser: correctly match keyed special categories by value being set (#89)
When parsing multiple special category blocks with different key values,
the second block would incorrectly overwrite the first instead of creating
a separate category entry.

Root cause:
When parsing a block like:

    wallpaper {
        monitor =
        path = /path/image.png
    }
    wallpaper {
        monitor = DP-1
        path = /path/image.png
    }

1. After closing the first block, `currentSpecialKey` resets to ""
2. When parsing `monitor = DP-1` in the second block, the code looks
   for an existing category where key value == currentSpecialKey ("")
3. The first category's key value IS "", so it matches incorrectly
4. The second block overwrites the first, leaving only one category

The fix:
When looking for an existing category to reuse, check what field we're
parsing:
- If parsing the KEY field itself, match by the VALUE being set
- If parsing other fields, match by currentSpecialKey (existing behavior)

This ensures `monitor = DP-1` looks for a category with `monitor == "DP-1"`,
not `monitor == ""`, allowing empty string keys to work correctly alongside
non-empty keys.

This bug affects any hyprlang consumer using keyed special categories where
empty string is a valid key value (e.g., hyprpaper's wallpaper category
with `monitor =` for default/wildcard).
2026-01-04 13:38:00 +01:00
..
config core/parser: correctly match keyed special categories by value being set (#89) 2026-01-04 13:38:00 +01:00
fuzz core: clang-tidy and comp fixes (#63) 2025-02-08 01:44:54 +01:00
parse core/parser: correctly match keyed special categories by value being set (#89) 2026-01-04 13:38:00 +01:00