[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mercurial-devel
Subject:    Re: [PATCH] Highlight word differences in diffs
From:       Martin Geisler <mg () lazybytes ! net>
Date:       2009-05-30 18:33:31
Message-ID: 87ljoe785g.fsf () hbox ! dyndns ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

Content-Transfer-Encoding: quoted-printable

Martin Geisler <mg@lazybytes.net> writes:

> # HG changeset patch
> # User Martin Geisler <mg@lazybytes.net>
> # Date 1243707986 -7200
> # Node ID 964cf1c47c0df37da99540b83a7aefed9b34a305
> # Parent  27cc4fa6722d97fa0d23bc990906d4d47ff43cff
> Highlight word differences in diffs

I forgot to update the commit message -- here are the changes.

> Things that are missing:
>
> * adjacent changes should probably be merged (like "_small_" and
>   "_paragraph_" above)

I now merge changed words together, and highlight them all in one go.

> * it is not clear if splitting on \W+ is the best choice

It wasn't, I don't know why I used that -- splitting on \s+ works much
better.

> * underlining can look funny, especially when a large amount of
>   inserted text is underlined

I've now made invert the default as suggested by Benoit. There are also
highlighters for GNU wdiff format, underline and HTML.

> * changes in the stuff between words is not highlighted. So if you
>   insert a comma, it wont be highlighted.

When splitting on whitespace this problem goes away.

> * this feature would look much better in hgweb...

Done with a simple style sheet change that colors the background
red/green.

> * probably some more :-)

It's probably still a bit hackish...

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.

[Attachment #5 (application/pgp-signature)]

_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@selenic.com
http://selenic.com/mailman/listinfo/mercurial-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic