Clear track change history

SyntaxEditor for WPF Forum

Posted 8 years ago by James Zheng
Version: 16.1.0632
Avatar

Hi Actipro,

I want to chear track cjhange indicators and I do as follow:

1. UndoHistory.Clear();

2. IsModified = false;

It works if the document is not modified. But if the document is not modified (saved state), the indicators won't be cleared, unless I set the modified flag to true before clearing the undo history.

Please adivise if there is a clean way to perform this task. Thanks.

Regards,

James Zheng

Comments (6)

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

Hi James,

Doing a programmatic text replacement in the document would clear everything but would require a new lex, parse, etc. too.

Other than that, what you said (with workaround as needed) is probably correct.


Actipro Software Support

Posted 8 years ago by James Zheng
Avatar

Hi Actipro,

It'll be great if we have a single function call in the document for this purpose.

Regards,

James Zheng

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

Hi James,

Can you describe the use case for this feature request?  In what scenarios would you do this sort of thing in your app?


Actipro Software Support

Posted 8 years ago by James Zheng
Avatar

Hi Actipro,

I want to clear away the history and change indicators when the document is in saved state. There are scenarios I need to discard these change indicators in some views for other users. I know reloading all text works, but that is too heavy.

I'm requesting this function, as the workaround is vulnerable to the behavior change in Actipro's code and none of the code in this workaround really belongs to us from a client's point of view.

Regards,

James Zheng

[Modified 8 years ago]

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

Hi James,

We have made this update for the next maintenance release:

Added an overload for the IUndoHistory.Clear method that specifies whether to also reset all change tracking, and added the IUndoHistory.Cleared event.


Actipro Software Support

Posted 8 years ago by James Zheng
Avatar

Thanks!

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.