Justin DeVuyst wrote:

> >> I am wondering if there is any effort or any interest in improving
> >> the character diff in vim.  Currently it only supports one longest
> >> match per line.  I think it would be a nice feature if it were more
> >> robust.  I may be motivated to do it if nobody else is or wants to.
> >> Any suggestions would be appreciated.
> >
> > I don't understand what you are saying.  Can you give a few examples?
> > What commands are you talking about?
> 
> Sorry for the vagueness.  I'm talking about the "Changed text
> inside a Changed line" as the vim docs say.  AKA the portion of
> a diff that's shown using the DiffText highlight group.  In fact,
> the docs describe better what I said in my original post:
> 
> Vim finds the first character that is different,
> and the last character that is different
> (searching from the end of the line).  The
> text in between is highlighted.  This means
> that parts in the middle that are still the
> same are highlighted anyway.
> 
> I'm proposing that this part of the diff go further and show
> all the changes by at least unhighlighting the characters
> that are not different if not going farther.  In effect a
> more granular and accurate diff at the character level.

If you think about it, you find that it is very difficult to define what
"changed" means.  Diff normally has delete, insert and change operators.
Applying that to a line of characters you can make a change in an
unlimited number of ways.  Some define the optimal way to be the one
that has the lowest number of operators, but that often leads to a weird
display.  E.g., when comparing "one two three four" with "one three two
four", what should be highlighted?  Perhaps "wo three" and "hree two",
because that's the changed part of the text.  Or "two" in both lines, as
it's deleted and inserted.  Or delete "wo t" and insert "hree t"?

Someone has mentioned a diff implementation for lines that is small
enough it could be included in Vim.  Perhaps it also works for a line
diff.

-- 
>From "know your smileys":
 C=}>;*{)) Drunk, devilish chef with a toupee in an updraft,
           a mustache, and a double chin

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui