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).
* config.cpp: fix parsing invalid hex
Instead of crashing on an invalid hex, return an error.
* config: return an error on an invalid hex value
* cleanup
* style: add references for catching exceptions
* style: ignore `std::out_of_range`
* core: handle scoped keywords if flags are not allowed
* chore: formatting
* test: add test cases for unintended categoryKeyword config options
* fix: use at() instead of []
* Fix compilation on 32-bit architectures
The 1234L suffix creates a 'long', which is not 64-bit on 32-bit architectures.
* Use stoll instead of stol to fix colors on 32-bit systems
on 32 bit systems, 'long' is 32 bits and 'long long' is 64 bits,
so the 'long long' functions need to be used.
* Fix rgba and rgb values on 32-bit
* Use a cast to Hyprlang::INT