diff view

David Nolden zwabel at googlemail.com
Fri Dec 7 18:01:06 UTC 2007


On Friday 07 December 2007 18:29:30 Vladimir Prus wrote:
> Hello,
>
> I would like to eventually implement a special view for diff files.
> That is, when a file with extension .diff is opened, I don't want it
> to be opened with Kate, but rather using a custom code, that will
> allow, among other things, to apply individual hunks of the diff file.
> (Whether such custom code will be implementing using Kompare, or really
> custom code, is not important here).
>
> So, how can I make kdevelop, when opening file with specific extension
> or mime type, to use a designated plugin?
>
> - Volodya
I cannot tell about this one. 

But generally about the diff thing:
For the teamwork plugin, I have already implemented a mechanism to highlight 
all applied hunks of a diff file in the editor, and to jump between the 
hunks. I think a similarly integrated thing would be perfect for selectively 
applying diff-files, and might be implemented without too much work based on 
the ripped kdiff3 library that's already in teamwork:

1. When opening a diff-file, you would need to see some side-panel where you 
see all the hunks. 

2. When you click a hunk, you would jump to the location of the hunk in the 
source-file, where the according text is highlighted(maybe green for applied, 
blue for not applied, and red for conflict)

3. When the cursor is within such a hunk in the source file, you could somehow 
see the alternative text for that hunk, and either apply/unapply the hunk.

For just showing a diff file, a kompare part would be just perfect.

greetings, David




More information about the KDevelop-devel mailing list