diff --git a/src/terminal/style.zig b/src/terminal/style.zig index deb2b8ec5..25ad5b59f 100644 --- a/src/terminal/style.zig +++ b/src/terminal/style.zig @@ -85,9 +85,10 @@ pub const Style = struct { /// True if the style is equal to another style. pub fn eql(self: Style, other: Style) bool { - // We convert the styles to packed structs and compare as integers - // because this is much faster than comparing each field separately. - return PackedStyle.fromStyle(self) == PackedStyle.fromStyle(other); + return @as(u16, @bitCast(self.flags)) == @as(u16, @bitCast(other.flags)) and + std.meta.eql(self.fg_color, other.fg_color) and + std.meta.eql(self.bg_color, other.bg_color) and + std.meta.eql(self.underline_color, other.underline_color); } /// Returns the bg color for a cell with this style given the cell