undo stack

edited June 2015 in Ruby Scripting
Is there any documentation on the undo stack?

I am looking for information on how to trigger undo/redo for a transaction.

Comments

  • edited June 2015

    Hi,

    You might be interested in the Manager class which is documented here.

    Regards, Chris

  • edited November -1
    that helps. Thanks, Chris!
  • edited June 2015

    Hi Chris,

    thanks very much for the comments!

    I just like to add that usually you won't need the manager object. The LayoutView#commit and LayoutView#transaction methods are usually sufficient:

    # Begins the transaction (undo/redo support)
    view.transaction("Description of your function")
    begin
    
      # your code goes here and will be undo/redo-tracked
    
    ensure
      # Always commit (also in case of an exception)
      view.commit
    end 
    

    Matthias

Sign In or Register to comment.