Posted 13 years ago by Robert Conde - Senior Systems Engineer, a.i. solutions
Avatar
Hi,
I would like to replace all the text currently in the syntax editor with alternate text and have it undoable with one ctrl+z. What would be the best way to accomplish that?

Robert Conde

Comments (3)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Instead of using Document.Text (which will wipe out the undo history), use the Document.UndoableInsert method and pass the entire document range as the range to replace.


Actipro Software Support

Posted 13 years ago by Robert Conde - Senior Systems Engineer, a.i. solutions
Avatar
Thanks - worked perfectly. I saw undoableInsert while trying to figure this out - but to me 'Insert' signified only an addition of characters so I didn't investigate further.

Robert Conde

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
As a side note, we've renamed those methods for v4.0 to be more clear. In v4.0 there will be AppendText, DeleteText, InsertText, and ReplaceText and all take the appropriate parameters for that sort of operation.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.