mirror of
https://github.com/hyprwm/hyprlang.git
synced 2024-11-16 18:25:57 +01:00
internal: fix bugs on non-existent dynamic special requests
This commit is contained in:
parent
7b7e7cdd07
commit
65a7f870a6
1 changed files with 7 additions and 1 deletions
|
@ -263,6 +263,8 @@ CParseResult CConfig::configSetValueSafe(const std::string& command, const std::
|
|||
|
||||
valueName += command;
|
||||
|
||||
const auto VALUEONLYNAME = valueName.contains(":") ? valueName.substr(valueName.find_last_of(':') + 1) : valueName;
|
||||
|
||||
auto VALUEIT = impl->values.find(valueName);
|
||||
if (VALUEIT == impl->values.end()) {
|
||||
// it might be in a special category
|
||||
|
@ -290,6 +292,10 @@ CParseResult CConfig::configSetValueSafe(const std::string& command, const std::
|
|||
if (sc->key.empty() || !valueName.starts_with(sc->name))
|
||||
continue;
|
||||
|
||||
// category does exist, check if value exists
|
||||
if (!sc->defaultValues.contains(VALUEONLYNAME) && VALUEONLYNAME != sc->key)
|
||||
break;
|
||||
|
||||
// bingo
|
||||
const auto PCAT = impl->specialCategories.emplace_back(std::make_unique<SSpecialCategory>()).get();
|
||||
PCAT->descriptor = sc.get();
|
||||
|
|
Loading…
Reference in a new issue