Skip to content

Commit 1653ae0

Browse files
Fix bug: restyling empty paragraph via style spans should return itself
1 parent 4044173 commit 1653ae0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public Paragraph<PS, SEG, S> restyle(int from, int to, S style) {
230230

231231
public Paragraph<PS, SEG, S> restyle(int from, StyleSpans<? extends S> styleSpans) {
232232
int len = styleSpans.length();
233-
if(styleSpans.equals(getStyleSpans(from, from + len))) {
233+
if(styleSpans.equals(getStyleSpans(from, from + len)) || length() == 0) {
234234
return this;
235235
}
236236

0 commit comments

Comments
 (0)