[resend, picky postmaster refused the message]

> > I suppose you made the structure of the return value work for your
> > purpose. It's a bit strange though: List of Dict of Dicts. And using a
> > special "end" item to indicate added or removed text (the help is not
> > clear, but I guess this is only used when a whole item was
> > added/removed, not when a word was added/removed).
> 
> The "end" item contains the end index and the byte offset of the diff hunk.
> If the string was not present earlier, then the byte offset cannot be
> calculated.  So it will be -1.   When a word is removed, it contains the
> position of the end of the word.

Before or after removing the word?  That's probably the main confusion
I'm seeing, that one has to translate the provided information into what
it really means.

> > Wouldn't it be easier to use when returning something similar to unified
> > diff:
> >
> > - Indicate range of deleted items (like a "-" line)
> > - Indicate range of inserted items (like a "+" line)
> > - Indicate a modified item (like a "-" line followed by a "+" line)
> 
> The start and end index values in the returned Dict does contain the
> above information (range of deleted or inserted or modified items).

Well, in some form.  My point is that it would be easier to interpret
the returned value if you put it in the form I suggested.

Note that some information goes missing when changing N lines/items to M
lines/items: some lines/items might only have a tiny change (e.g.
indent) while other lines/items may have been completely removed or
inserted.  There was someone who looked into this (mostly for how to
display a diff hunk) but I haven't heard about it for a long time.
In case this work gets picked up, it would be nice if it can be included
in the returned value.

-- 
If you had to identify, in one word, the reason why the
human race has not achieved, and never will achieve, its
full potential, that word would be "meetings."

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230502234621.30CC41C0916%40moolenaar.net.

Raspunde prin e-mail lui