From b6a5408fbc7653fc69b79138e68244bb915deaae Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Sat, 20 Jul 2024 13:05:50 -0700 Subject: [PATCH] Fix MLC equality operator --- SourceGen/MultiLineComment.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SourceGen/MultiLineComment.cs b/SourceGen/MultiLineComment.cs index 9ca0479..15add20 100644 --- a/SourceGen/MultiLineComment.cs +++ b/SourceGen/MultiLineComment.cs @@ -994,7 +994,7 @@ namespace SourceGen { return false; // one is null } return a.Text.Equals(b.Text) && a.BoxMode == b.BoxMode && a.MaxWidth == b.MaxWidth - && a.BackgroundColor == b.BackgroundColor; + && a.BackgroundColor == b.BackgroundColor && a.IsFancy == b.IsFancy; } public static bool operator !=(MultiLineComment a, MultiLineComment b) { return !(a == b); @@ -1003,7 +1003,8 @@ namespace SourceGen { return obj is MultiLineComment && this == (MultiLineComment)obj; } public override int GetHashCode() { - return Text.GetHashCode() ^ MaxWidth ^ (BoxMode ? 1 : 0) ^ BackgroundColor.GetHashCode(); + return Text.GetHashCode() ^ MaxWidth ^ (BoxMode ? 1 : 0) ^ (IsFancy ? 2 : 0) ^ + BackgroundColor.GetHashCode(); } } }