Skip to content

Commit c90cb8c

Browse files
Fix bug: ignore styles when both texts are empty segs
1 parent 2c7b5e8 commit c90cb8c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

richtextfx/src/main/java/org/fxmisc/richtext/model/StyledText.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ public String toString() {
143143
public boolean equals(Object obj) {
144144
if(obj instanceof StyledText) {
145145
StyledText<?> that = (StyledText<?>) obj;
146-
return Objects.equals(this.text, that.text)
147-
&& Objects.equals(this.style, that.style);
146+
return (this.text.isEmpty() && that.text.isEmpty())
147+
|| (Objects.equals(this.text, that.text)
148+
&& Objects.equals(this.style, that.style));
148149
} else {
149150
return false;
150151
}

0 commit comments

Comments
 (0)