mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-07 23:25:57 +01:00
use cvarlist for ws rules
This commit is contained in:
parent
27370f3e07
commit
d23884e8e7
1 changed files with 3 additions and 9 deletions
|
@ -2148,18 +2148,12 @@ std::optional<std::string> CConfigManager::handleWorkspaceRules(const std::strin
|
||||||
return {};
|
return {};
|
||||||
};
|
};
|
||||||
|
|
||||||
size_t pos = 0;
|
CVarList rulesList{rules, 0, ',', true};
|
||||||
std::string rule = rules;
|
for (auto& r : rulesList) {
|
||||||
while ((pos = rules.find(',')) != std::string::npos) {
|
const auto R = assignRule(r);
|
||||||
rule = rules.substr(0, pos);
|
|
||||||
const auto R = assignRule(rule);
|
|
||||||
if (R.has_value())
|
if (R.has_value())
|
||||||
return R;
|
return R;
|
||||||
rules.erase(0, pos + 1);
|
|
||||||
}
|
}
|
||||||
const auto R = assignRule(rule); // match remaining rule
|
|
||||||
if (R.has_value())
|
|
||||||
return R;
|
|
||||||
|
|
||||||
wsRule.workspaceId = id;
|
wsRule.workspaceId = id;
|
||||||
wsRule.workspaceName = name;
|
wsRule.workspaceName = name;
|
||||||
|
|
Loading…
Reference in a new issue