Remove an Item from the Undo / Redo Stacks?

SyntaxEditor for Windows Forms Forum

Posted 9 years ago by Cody Thompson - Space Systems Engineer, a.i. solutions
Version: 12.1.0302

Hi again. Sorry for the barrage of questions, but I'm really testing the limits of my Actipro knowledge with my most recent project.

I didn't find anything in the documentation for it, so I fear it may not exist, but I will ask anyway. Is it possible for me to remove items from the undo / redo stacks? If not, is it possible for me to tell the Document.InsertText and Document.DeleteText methods to not add to the undo / redo stacks? If neither of these things is possible, is there a suitable work-around at all?

Thanks in advance!

Comments (2)

Answer - Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Cody,

Sorry but you can't really do those things.  The undo stack is where we store a sequence of operations to undo.  If you would start deleting items in it (or not adding them in the first place) then it would become corrupted since each undo item is a delta from the item before it.

One thing you can do however is combine multiple text modifications into a single undoable group.  So that they only appear as one undo stack item.  The UndoRedo object has StartGroup and EndGroup methods you wrap around text modifications to achieve that.

Actipro Software Support

Posted 9 years ago by Cody Thompson - Space Systems Engineer, a.i. solutions

Hrm, fair enough. That grouping is enough to make a passable result for what I'm trying to do, and I guess that'll have to be good enough. Thanks!

The latest build of this product (v21.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.