Can't undo changes on Text property?

SyntaxEditor for WPF Forum

Posted 13 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 13 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 13 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 13 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 (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.