Text Difference & Merge Engine

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Rowland Friebely
Avatar
Is there a commerically-available text difference and merge engine that could be integrated with SyntaxEditor?

Comments (9)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We haven't really looked into it but SyntaxEditor's UI features are ideal for displaying text differences. With the use of span indicators, it's easy to highlight difference areas in the text.

Maybe in the future we could make some sort of add-on that does this automatically by using two SyntaxEditors side-by-side. It would be great since there would be full syntax-highlighting in the code as well.


Actipro Software Support

Posted 14 years ago by Boyd - Automated Software Testing Consultant / Developer, Patterson Consulting, LLC
Avatar
This is something I've thought about using SyntaxEditor for as well. The biggest issue with having two editors side-by-side deals with line numbering. You may have to insert "buffer" lines in one editor to keep the portions of the document side-by-side. SyntaxEditor lets you start numbering at any location, but I don't think it lets you break up the line numbering like that.

So it could likely be done, but without line numbering present.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Actually, that used to be an issue however we added a DocumentLine.CustomLineNumber property a little while back. If you set it to an empty string ("") then it will not show a number. You can set it to any other string (most likely a number) and it will display that. So you do have total control over the line number display.


Actipro Software Support

Posted 14 years ago by Karl Grambow
Avatar
I'm actually using SyntaxEditor for this purpose. I managed to to find a DifferenceEngine in C# that works quite well and I subsequently modified it slightly and ported it over to VB.NET.

Having two SyntaxEditors side by side works really well too. The DifferenceEngine I'm using automatically adds line buffers where necessary so the two documents will always line up when side by side.

I'm using SyntaxEditor's ViewVerticalScroll and ViewHorizontalScroll events to make sure that both editor's scroll simultaneously.

I can't remember the exact link for the C# Difference Engine but have a look for "Difference Engine" or "Difference Algorithm" on google or codeproject.com. That's assuming you're willing to mess about with it to get it working as you wish.

If you're interested in the engine dll that I have in VB.NET I can mail it to you if you want but of course I can't offer in guarantees with it.

Karl
Posted 14 years ago by Boyd - Automated Software Testing Consultant / Developer, Patterson Consulting, LLC
Avatar
That's right... I forgot about the custom line numbering option. SyntaxEditor handles everything! :)

Karl, It's great that you've made this work. I'd love to take a look at the DLL you've created if you don't mind to e-mail it. Could you please send it to bpatterson@patterson-consulting.net? Source Code would be lovely, but anything would be appreciated.

Boyd
Posted 14 years ago by Boyd - Automated Software Testing Consultant / Developer, Patterson Consulting, LLC
Avatar
Posted 14 years ago by Karl Grambow
Avatar
That second link, on codeproject, is what I've based my diff viewer on - except mine is in vb.net. I've also watered it down a lot, removing a lot of unnecessary stuff. And rather than compare two files I'm comparing to string variables.

I'll send you the source code and a test project that uses syntaxeditor.

Karl
Posted 14 years ago by Rowland Friebely
Avatar
Karl,

I don't know if my previous message made it ... Thanks - I found the C# difference engine, and yes, I be very interested in your VB.NET engine DLL.

Regards, Rowl
Posted 14 years ago by Karl Grambow
Avatar
Sure, just give me an email address or mail me at

karlgrambow@hotmail.com

[Modified at 08/26/2005 08:39 AM]
The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.