<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Jurgen:</div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for the feedback! The main reason I've decided to remove this parameter is that selectively disabling / enabling undo functionality messes up the internal state.</div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Perhaps, when the application edits/styles the document on its own, it should do it in steps - for example, I noticed that Apple Notes allows the user to undo the auto-format like bulleted list (I think MS Word does a similar thing). Also, there is currently
no way to coalesce undo records (see <a href="https://bugs.openjdk.org/browse/JDK-8370447" data-outlook-id="fd879415-53d1-4749-96bb-bc9230571d4a">
https://bugs.openjdk.org/browse/JDK-8370447</a> ) and no API to allow the model to customize the process.</div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 16px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);">I do want to understand your use case - can you explain it in more detail please? Give me an example of the expected behavior?</span></div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 16px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);"><br>
</span></div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 16px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);">Thanks!</span></div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 16px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);">-andy</span></div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 16px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);"><br>
</span></div>
<div id="mail-editor-reference-message-container">
<div dir="ltr" class="ms-outlook-mobile-reference-message skipProofing"></div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="text-align: left; padding: 3pt 0in 0in; border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) currentcolor currentcolor; font-family: Aptos; font-size: 12pt; color: black;">
<b>From: </b>openjfx-discuss <openjfx-discuss-retn@openjdk.org> on behalf of Jurgen Doll <jurgen@ivoryemr.co.za><br>
<b>Date: </b>Thursday, October 30, 2025 at 09:35<br>
<b>To: </b>openjfx-discuss@openjdk.org <openjfx-discuss@openjdk.org><br>
<b>Subject: </b>RichTextArea undo style ContentChange<br>
<br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing">Hi Andy</div>
<div dir="ltr" class="ms-outlook-mobile-reference-message skipProofing"><br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing">In view of your current "remove allowUndo parameter" PR, I took another look at why I requested that applyStyle and setStyle also have that parameter. Part of the reason, I have now discovered, is
due to a bug in the way that undo is processed.</div>
<div dir="ltr" class="ms-outlook-mobile-reference-message skipProofing"><br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing">Basically when undoing a STYLE ONLY change an event is fired where ContentChange.isEdit returns true when it should be false. To fix, I think that the UndoableChange.create() method needs a styleOnly
flag (or maybe another method needs to be added for style only changes). Then when the UndoableChange.undo method is called it can invoke model.applyStyle() with appropriate values instead of model.replace() which will then trigger the correct event.</div>
<div dir="ltr" class="ms-outlook-mobile-reference-message skipProofing"><br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing">Note that even with this fixed though, it might still be desirable to be able to add/remove styling with an undo parameter. The use case I have is that only user styling actions are on the undo stack
but programmatic changes for spellchecking or other markup are skipped if desired. The effect this has is that when the user undoes something it's directly related to what they have just done and not what the program has done.</div>
<div dir="ltr" class="ms-outlook-mobile-reference-message skipProofing"><br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing">Thanks, regards</div>
<div class="ms-outlook-mobile-reference-message skipProofing">Jurgen</div>
</div>
</body>
</html>