From 817056cf8b0e079f7524560c01153f2b23dcabe9 Mon Sep 17 00:00:00 2001 From: Yves Biener Date: Tue, 7 Jan 2025 13:08:13 +0100 Subject: [PATCH] fix(style): apply merging only if it differs from the default values --- src/terminal/Style.zig | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/terminal/Style.zig b/src/terminal/Style.zig index af0b137..7f739bb 100644 --- a/src/terminal/Style.zig +++ b/src/terminal/Style.zig @@ -120,13 +120,13 @@ pub fn merge(this: *@This(), other: @This()) void { if (other.bg != .default) this.bg = other.bg; if (other.ul != .default) this.ul = other.ul; if (other.ul_style != .off) this.ul_style = other.ul_style; - if (other.bold == false) this.bold = other.bold; - if (other.dim == false) this.dim = other.dim; - if (other.italic == false) this.italic = other.italic; - if (other.blink == false) this.blink = other.blink; - if (other.reverse == false) this.reverse = other.reverse; - if (other.invisible == false) this.invisible = other.invisible; - if (other.strikethrough == false) this.strikethrough = other.strikethrough; + if (other.bold != false) this.bold = other.bold; + if (other.dim != false) this.dim = other.dim; + if (other.italic != false) this.italic = other.italic; + if (other.blink != false) this.blink = other.blink; + if (other.reverse != false) this.reverse = other.reverse; + if (other.invisible != false) this.invisible = other.invisible; + if (other.strikethrough != false) this.strikethrough = other.strikethrough; } fn start(this: @This(), writer: anytype) !void {