Document.Text not in Undo stack?!

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Jason Whitted - Owner, Etalisoft, LLC
Avatar
I'm sure I'm just missing something, but I haven't been able to find the simple way to accomplish what I'm trying to do.

I am creating a method which will auto-format the document. The method takes the text from the document and parses it into a StringBuidler. The next step is to set the SyntaxEditor.Document.Text to the StringBuilder. This works, but I am unable to "Undo" the operation.

How can I replace the text in the document and have the original text be in the Undo stack?

Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Setting the Document.Text property will clear the undo stack. To replace all the text without clearing the undo stack, use Document.UndoableInsert and specify the entire text range as being replaced.


Actipro Software Support

Posted 14 years ago by Jason Whitted - Owner, Etalisoft, LLC
Avatar
Perfect! I definitely wasn't expecting a response on New Years Day. Thanks a lot!
The latest build of this product (v2018.1 build 0341) was released 9 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.