forge
Explore
Log in

Don't you dare go Hollow

config: Fix border rule on -> off merging

Browse files at this commit

4e357e9659e5aafeec3cdeb18581698716d97a78Ivan MolodetskikhParent: 1f8aed6
niri-config/src/lib.rsmodified+11 -4
@@ -1589,8 +1589,15 @@ impl Default for Config {
15891589
15901590 impl BorderRule {
15911591 pub fn merge_with(&mut self, other: &Self) {
1592- self.off |= other.off;
1593- self.on |= other.on;
1592+ if other.off {
1593+ self.off = true;
1594+ self.on = false;
1595+ }
1596+
1597+ if other.on {
1598+ self.off = false;
1599+ self.on = true;
1600+ }
15941601
15951602 if let Some(x) = other.width {
15961603 self.width = Some(x);
@@ -3900,12 +3907,12 @@ mod tests {
39003907
39013908 assert_snapshot!(is_on("off", &["off", "off"]), @"off");
39023909 assert_snapshot!(is_on("off", &["off", "on"]), @"on");
3903- assert_snapshot!(is_on("off", &["on", "off"]), @"on");
3910+ assert_snapshot!(is_on("off", &["on", "off"]), @"off");
39043911 assert_snapshot!(is_on("off", &["on", "on"]), @"on");
39053912
39063913 assert_snapshot!(is_on("on", &["off", "off"]), @"off");
39073914 assert_snapshot!(is_on("on", &["off", "on"]), @"on");
3908- assert_snapshot!(is_on("on", &["on", "off"]), @"on");
3915+ assert_snapshot!(is_on("on", &["on", "off"]), @"off");
39093916 assert_snapshot!(is_on("on", &["on", "on"]), @"on");
39103917 }
39113918 }