Implementing UNDO

Brian Milby brian at milby7.com
Fri May 21 10:25:29 EDT 2021


For text, the method will depend on the size of the text.  In general, implement an undo stack and a redo stack.  For single line fields it could simply be a list for each.  After each change, add entry to undo list and clear redo list.  When doing undo, move entries to redo list allowing forward/backward movement between changes.

For longer text, an array based stack could be used.  Either store the full text or use the diff library - method will depend on size of text.

Sent from my iPhone

> On May 21, 2021, at 9:28 AM, Klaus major-k via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Hi Mike,
> 
>> Am 21.05.2021 um 15:23 schrieb Mike Kerner via use-livecode <use-livecode at lists.runrev.com>:
>> 
>> I _think_ that there might also be an undo manager built into levure, if
>> you are interested.
> 
> oh, OK, sounds great, will take a look!
> Thank you!
> 
> 
> Best
> 
> Klaus
> --
> Klaus Major
> https://www.major-k.de
> https://www.major-k.de/bass
> klaus at major-k.de
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list