yysun/Git-Source-Control-Provider — pull request #43 by sharwell (2013-02-06 05:20:17+00:00)
Title: Git Diff Margin

Pull request #42 is a prerequisite for this pull request.

This pull request integrates a modified version of the [GitDiffMargin](https://github.com/laurentkempe/GitDiffMargin) extension into Git-Source-Control-Provider. @laurentkempe (original author of GitDiffMargin) provided the following notice:

> Hi Sam
>
> Great to hear from you Sam and the great work you have done using GitDiffMargin.
>
> I have checked the license of Git Source Control Provider - https://github.com/yysun/Git-Source-Control-Provider and it is a GNU GENERAL PUBLIC LICENSE Version 2
>
> It would be acceptable for me to have GitDiffMargin through your integration going into Git Source Control Provider.
> But I am also very much interested to integrate your changes directly in GitDiffMargin because I am not using Git Source Control Provider, how would you see that and would you be ready to help?
>
> I still need to check which license model I want to apply to GitDiffMargin, I will have a look tomorrow morning it will be either GPL v2 like Git Source Control Provider or even a less restrictive
>
> Cheers
> Laurent Kempé

This integration modifies the original extension in the following ways:

* Visual
* Moved the margin to the right of the spacer margin (which contains the Track Changes coloring)
* Exported EditorFormatDefinition classes for the user to customize the colors used by the extension
* Show the triangle for Removed hunks between the two lines bounding the change (instead of pointing right at one of the lines)
* Update the position calculation to allow lines with different font sizes, such as those used by the Markdown Mode extension
* Use thin rectangles which match the style of the Track Changes margin
* Use tracking spans to create better estimates of diff positions when the user enters a new line
* Rollback
* Fixed the Rollback command behavior (especially when used for different line endings)
* Implemented rollback for Addition hunks
* Ensure the rollback is not attempted if the current snapshot differs from when the diff margin last computed diff information
* Other behavior
* Operate on the text currently in the text buffer instead of text on disk
* Use NGit library with the HistogramDiff algorithm to perform the actual diff operation (no more dependency on git.exe)
* Use a background parser to recompute the diff 0.5 seconds after the last keystroke is typed in a sequence by the user

The following image shows the extension as currently integrated.

![IMG_05022013_102006](https://f.cloud.github.com/assets/1408396/130447/91a6b362-701c-11e2-8070-2bef66d24983.png)