Format text externally without losing undo stack

SyntaxEditor for WPF Forum

Posted 4 years ago by James Kester - Metafile Information Systems, Inc.
Version: 15.1.0623
Avatar

Hello, I have a function that formats the text in the syntaxEditor and then sets the formatted stirng back to the syntaxEditors.text property. I see in the forums here that setting the syntaxEditors.text property clears the undo stack. I also see answers talking about syntaxEditors.Document.UndoableInsert which sounds like what i want, however my control doesnt seem to have that function. Basically what im trying to accomplish is to take the unformatted text from the syntaxEditor, then format it in some function, then set the formatted text back to the syntaxEditor, while still retaining the undo stack, so that the user can undo the formatting if they choose.  How can i accomplish this?

Comments (2)

Posted 4 years ago by James Kester - Metafile Information Systems, Inc.
Avatar

Document.SetText(TextChangeTypes.AutoFormat, value); seems to do the trick. that was easy!

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi James,

Yes, that should do it.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) 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.