On Wednesday, June 13, 2012 3:53:44 PM UTC-5, Bram Moolenaar wrote:
> Ben Fritz wrote:
> 
> > 
> > OK, so Vim can still combine adjacent blocks. But can it be be updated
> > to use this assumption, yet correctly handle any valid ed-style diff
> > (in terms of adding diff filler and alignment of lines which are part
> > of the same hunk in the diff)?
> 
> What valid ed-style diff is not handled?  Note that a diff with two
> adjecent blocks is not valid, diff will never produce it.
> 

Why is a diff with adjacent blocks not valid? How do you know a posix-compliant 
diff will never produce it? I don't see anything in man pages online about 
limitations on adjacent hunks. I Googled for "posix diff format" and looked at:

http://www.unix.com/man-page/posix/1posix/diff/
http://pubs.opengroup.org/onlinepubs/007904875/utilities/diff.html
http://pubs.opengroup.org/onlinepubs/007908799/xcu/diff.html
http://www.gnu.org/software/hello/manual/diff.html#Detailed%20ed

Even if diff itself only finds non-overlapping sections due to the algorithm 
used ( http://en.wikipedia.org/wiki/Diff#Algorithm ), the *output format* does 
not have this limitation. Indeed, rather than a single "change" operation, a 
diff tool could decide to output both a deletion and an addition at the same 
location, and as far as I can tell this should be considered valid input. 
Handling this last scenario might very well break what I'm trying to do anyway, 
but even so, Vim should not completely fail to highlight the second file as 
shown in the screenshots I posted earlier. And, I think it should be possible 
to handle such situations and still align lines affected by a "change" action 
in the diff.

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui