Hi Bram, On Wed, May 3, 2023 at 2:55 PM Bram Moolenaar <[email protected]> wrote: > > > > > I have updated the PR to include the "count" item to "from" and "to". > > > > It indicates the number of items added or modified. > > > > > > The help for this is: > > > > > > count number of items added/removed/modified in this diff > > > hunk. > > > > > > I'm afraid this doesn't really help. First of al, I would expect the > > > info not inside the "from" and "to" Dicts, but besides them. And I > > > would expect a separate number for items added/deleted and items > > > modified. Something like: > > > > > > Each item in the returned List is a Dict containing > > > information about a diff hunk. Each Dict contains the > > > following items: > > > from Dict with {list1} diff hunk information > > > to Dict with {list2} diff hunk information > > > extra Number of items added (positive) or > > > removed (negative) > > > modified Number of items that were modified > > > > > > > I have updated the PR to add the "added" and "modified" items for every > > diff hunk. > > The "added" item will be positive if new strings are added to the original > > List > > and will be negative if strings are removed from the original List. The > > "modified" > > item indicates the number of strings modified from the original List. > > I have also removed the "count" item. > > Thanks for using the suggestions. > > One more thing to keep in mind: Creating a Dict and putting items in it > has quite a bit of overhead. The two levels of Dicts means the function > is not going to be efficient. For short lists this might not matter > much, but what if it is used on a long list? Perhaps using one Dict per > hunk would be OK without making it less usable. Might even make it > simpler to understand. >
I have updated the PR to reduce one level in the Dict. I cannot make it a single flat Dict as we need to separate out the "from" and "to" position information. Regards, Yegappan -- -- 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/CAAW7x7k3YE8iwck-VW8L72NuMHkLj9WiCYc8B0z%2Bq4aVCRnyDQ%40mail.gmail.com.
