> > What is SES?
> 
> It stands for shortest edit script: https://arxiv.org/abs/2208.08823
> 
> > I can modify the new diff() function to return a value similar to that
> > returned by the
> > Neovim vim.diff() function.  i.e. either a string with the unified diff or
> > a List with the indices.
> > We can then add an additional option ("range" or "extended" or "position")
> > to return
> > the starting and ending position of the change in the old and the new text.
> > 
> > Bram: What do you think about this approach?
> 
> I think adding an option to select the behaviour would be a good idea,
> as it allows for all usecases.
> Even though Bram is right about the `join()` being inefficient as a 
> `diffexpr`, the unified diff may still be useful for some other usecases.
> But of course it's @brammool call in which direction to go here.

As mentioned before, the proposed return value includes column numbers,
it has more information than a unified diff.  It should not be difficult
to turn the returned information into a unified diff if really needed.
Although I doubt it would be useful in more than a few cases.

It's easy to think of all kinds of options to add to return the diff in
various forms.  But do we really need it?  I rather just provide the
basic functionality, what would be slow to do in Vim script, and return
the result in a form that is easy to use for several purposes.

-- 
>From "know your smileys":
 8-O    "Omigod!!" (done "rm -rf *" ?)

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230531114816.C04341C0916%40moolenaar.net.

Raspunde prin e-mail lui