summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-04-02 22:17:57 +0200
committerRobin Jarry <robin@jarry.cc>2023-04-02 22:57:30 +0200
commit63019343660049eadb2273a7ea0e13a2a0580b51 (patch)
tree616222b6cbb15a1f80c9e370c769b7c3164336fa
parent1540d645dff3c610d7d25c47699ec1313601303b (diff)
downloadaerc-63019343660049eadb2273a7ea0e13a2a0580b51.tar.gz
aerc-63019343660049eadb2273a7ea0e13a2a0580b51.zip
stylesets: fix *.selected parsing
The stylesets are parsed in two passes. The first pass skips the .selected keys and updates the attributes and colors of both the objects and selected maps. The second pass is supposed to only update the selected map of the pointed style objects. The boolean logic was incorrect, the .selected styles were applied on normal objects as well which led to confusing behaviour most specifically when using *.selected.toggle=true. Properly parse .selected elements. Fixes: 47675e80850d ("config: rework styleset parsing") Reported-by: John Mcenroy <handplanet@outlook.com> Reported-by: Kirill Chibisov <contact@kchibisov.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Kirill Chibisov <contact@kchibisov.com>
-rw-r--r--config/style.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/config/style.go b/config/style.go
index 79bd69d1..ee171fcb 100644
--- a/config/style.go
+++ b/config/style.go
@@ -423,7 +423,7 @@ func (ss *StyleSet) parseKey(key *ini.Key, selected bool) error {
if groups == nil {
return errors.New("invalid style syntax: " + key.Name())
}
- if groups[4] == ".selected" && !selected {
+ if (groups[4] == ".selected") != selected {
return nil
}
obj, attr := groups[1], groups[5]