On Fri, Jul 14 vitalije wrote:

> I just wished to illustrate how dangerous and tricky things can get when
we have mutable state buried so deep down in the foundations of Leo's code.

I agree. That's what PR #3438
<https://github.com/leo-editor/leo-editor/pull/3438> fixes, as follows:


- The undo code for parse-body now uses bespoke undo/redo code.


- All commands that previously used the retired "change tree" logic
(u.before/afterChangeTree, etc.) now use the undo/redo insert-node logic.


I don't see how offline data structures help recreate clones. How do they
simulate Leo's low-level VNode operations?


In contrast, the PR's new undo/redo insert-node logic deletes/inserts a
*single* node, thereby using the low-level operations. This change is safe.
Leonistas insert and delete nodes all the time :-)

On FĂ©lix's advice, PR #3438 clears Leo's undo-related state when performing
undoable commands. This change should fix previous problems with clones.


Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS3T%2B9RCrAW9VUpMyr2Vk_-TND1NhygQ1vkr7WdFug6qSg%40mail.gmail.com.

Reply via email to