Paul Jolly wrote:
> Thanks for your other response. Not sure whether my message below came > through. > > It seems I'm going to have to do a bit more work on the list of > changes that comes through. > > In the example, I think I actually need to collapse the two changes > into a single one with added = 2. > > Then do a pass over the resulting list getting the lines based on the > current buffer. > > Which I think brings us back to the non-overlapping changes question I > think. Because the second change overlaps with the first, which is > what causes my logic to fail. > > Is that about right? The changes were made in the order they are in the list. They can overlap, but only in a way that a later change does not change the line number of an earlier change. Thus getting the text from the current state of the buffer will result in the right line, but a later change may have changed the content of that line. It would be possible to report every single change separately, but that is inefficient, especially when making several changes to the same line, e.g. when manipulating an XML file, these tend to have very long lines. The current implementation assumes that the final state of the text lines is what matters. -- hundred-and-one symptoms of being an internet addict: 10. And even your night dreams are in HTML. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ 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/201905222029.x4MKTc0Y001079%40masaka.moolenaar.net. For more options, visit https://groups.google.com/d/optout.
