Can't undo changes on Text property?

SyntaxEditor for WPF Forum

Posted 8 years ago by SledgeHammer01
Version: 11.1.0545
Avatar
Seems like if I set the Text property, the internal undo buffer is cleared and ctrl-z can no longer undo. Is there a way to replace all the text without loosing the undo?

Comments (3)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes, the Text property is only for data-binding purposes and shouldn't normally be used.

The document has a SetText method with an overload where you can pass an ITextChangeType to it. If you use that overload, it will replace the text without clearing the undo history.


Actipro Software Support

Posted 8 years ago by SledgeHammer01
Avatar
This kind of works... I call:

_syntaxEditor.Document.SetText(ActiproSoftware.Text.TextChangeTypes.ReplaceAll, ((Script)listView.SelectedItem).Text);

now, ctrl+z does undo back to the previous text, but the entire document is highlighted. Is there a way to do it so that the document is not highlighted on a ctrl+z?
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sorry but no, that is a built-in feature of undo.


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.