How can I highlight text edits in a SyntaxEditor?

SyntaxEditor for WPF Forum

Posted 12 years ago by Craig - Varigence, Inc.
Version: 12.1.0562
Avatar

I have a MDI application where users can open multiple documents and make edits. I'd like the application to have a view that lists all edited documents. When a user selects an edited document, its contents appear in a read-only syntax editor with the edits highlighted.

  1. Is there a mechanism for having a SyntaxEditor highlight text edits, starting from when a document is opened? While I am aware that highlights can appear in the left margin, to indicate some change happened within a line, I'd like the actual changed/added characters to be highlighted.
  2. Is there a way to transfer those snapshots to another syntax editor, so that it can highlight the same changes?
Alternatively, do you have any WPF or WinForms text diff'ing tools? 

Thanks,

-Craig

[Modified 12 years ago]

Comments (1)

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

Hi Craig,

1/2)  Sorry we don't have anything like that.  If you keep a reference to the original snapshot then you can look at its Version.  Each ITextVersion has an Operations property that tells the operations that occurred to make that version.  The next version is in its Next property.  But keep in mind the operation offets are all relative to the state of the document at that point.  So while you can get all this change history over time, it may be difficult to use on your end, and you may be better off tracking what info you need by watching DocumentTextChanged events and updating some custom data structure along the way.

2)  No, sorry we don't have any diff tools.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.