magit/magit — pull request #352 by snogglethorpe (2012-01-21 05:25:24+00:00)
Title: Refine current diff hunk using `diff-refine-hunk'

This just uses diff-mode's "diff-refine-hunk" to highlight exactly those parts of the current magit hunk which have changed. This is _really_ useful for textually small changes in long lines of code, where it can be very hard to actually see what's what's change, and easy to miss something when scanning by eye.

diff-refine-hunk is pretty clever, so in general it doesn't result in "over-highlighting" -- for instance, it doesn't add additional hilighting for big insertions/deletions (those are obvious from the basic hunk display), and it alights fine-change highlighting to word boundaries to avoid the "insert one character, delete another, 50 times" problem of naive fine-change displays.

To avoid leaving a trail, it removes the refinements when the current hunk (really section) changes.