You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you delete a character from styled text, and then Undo, it should work without throwing an exception.
Actual Behavior
An exception is thrown, under these conditions:
The styled text must be on a line where there are two styles present, e.g. bold followed by italics.
And the deletion must occur on the second styled text.
Variations
if the Delete key + undo is done on the first styled text of that line, it works fine.
if the line is all bold or all italics, then Delete key + undo works fine on any word on the line.
Reproducible Demo
Run the demo program RichTextDemo (provided in your download area), so that stdout and stderr will appear (e.g., under an IDE)
Open sample.rtfx
go to line 3, the italicized line, copy the word 'Italicized' and paste it onto end of line 2, the bold line. now we have two different styles on the line.
click within 'Italicized' on line 2
hit the Delete key
hit Ctl-Z
at this point the exception is thrown:
Exception in thread "JavaFX Application Thread" java.lang.IllegalArgumentException: Unexpected change received.
at org.fxmisc.undo.impl.UndoManagerImpl.changeObserved(UndoManagerImpl.java:234)
at org.reactfx.util.QueuingStreamNotifications.lambda$head$0(NotificationAccumulator.java:217)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
at org.reactfx.SuspendableBase.resume(SuspendableBase.java:64)
at org.reactfx.CloseableOnceGuard.close(Guard.java:49)
at org.reactfx.MultiGuard.close(Guard.java:83)
(rest of stack deleted)
Environment info:
RichTextFX Version: 0.10.0
Flowless 0.6.1
ReactFX 2.0-M5
UndoFX 2.1.0
WellBehavedFX 0.3.3
Operating System: Windows 10
Java version: 8u181
The text was updated successfully, but these errors were encountered:
@Kim4444 Thanks for reporting the bug and providing clear steps to reproduce.
I did some debugging and have found the problem to be here, so will submit a PR soon.
Expected Behavior
If you delete a character from styled text, and then Undo, it should work without throwing an exception.
Actual Behavior
An exception is thrown, under these conditions:
Variations
Reproducible Demo
Exception in thread "JavaFX Application Thread" java.lang.IllegalArgumentException: Unexpected change received.
Expected:
[RichTextChange{
position: 43
removed: Par[; StyledSegment(segment=left() style=true,12,Serif,0x000000ff)]
inserted: Par[; StyledSegment(segment=left(c) style=true,12,Serif,0x000000ff)]
}]
Received:
[RichTextChange{
position: 43
removed: Par[; StyledSegment(segment=left() style=true,12,Serif,0x000000ff)]
inserted: Par[; StyledSegment(segment=left(c) style=true,12,Serif,0x000000ff)]
}]
Environment info:
The text was updated successfully, but these errors were encountered: