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).
Use nixbuild/nix-quick-install-action which pairs well with
nix-community/cache-nix-action.
Should help with build times by reducing the number of packages needing
to be re-downloaded on each run.
Parameters are taken from https://github.com/nix-community/cache-nix-action
and may be tweaked later.
This changeset makes it possible to compile hyprlang with a custom
install prefix, which was not honored because of using "hyprutils" as
a raw dependency, which means that CMake was adding "-lhyprutils" flag
to the linker, but the linker didn't know the path in case a custom
install prefix was used to compile hyprutils.
* 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`