Implementing UNDO

Trevor DeVore lists at
Sat May 22 12:49:00 EDT 2021

On Fri, May 21, 2021 at 3:11 PM Mike Kerner via use-livecode <
use-livecode at> wrote:

> fyi, for posterity, here is the link to the wiki for levure's undo manager
> helper

Here is a link to the code:

This should be easy enough to add to any app. I just checked the code and
there are no calls to any functions or commands in the Levure framework
itself. If you look at the helper.yml file you see this:

  - filename: undoManager.livecodescript
  - filename: field_edits_undo.livecodescript
    autoload: false

What that means is that you should `start using stack
"undoManager.livecodescript"` when your app starts up and `put there is a
stack "field_edits_undo.livecodescript" into tStackIsNoInMemory`. (Note
that it is left as an exercise to the reader to determine the full path to
those stacks when being used in your app.) The
`field_edits_undo.livecodescript` stack just needs to be in memory so that
`undoManager.livecodescript` can insert it into the front whenever the user
is editing text in a field.

Trevor DeVore

More information about the use-livecode mailing list