Thanks very much.

> Up to you.  You can merge the changes into one, keeping the lowest
> changed line number and the total deleted/added lines, or you can deal
> with each change separately.

I'm not sure I see how the change can be handled separately (without
carrying forward position changes) in my case because it's only the
combined result of the two changes that tells me I also need to
include line 3.

The first change:

{'lnum': 1, 'col': 12, 'added': 1, 'end': 2}

tells me I need to change line 1 in my plugin's version of the buffer,
and then I should insert line 2 from the current buffer state after
line 1 in my plugin's version of the buffer.

The second change:

 {'lnum': 2, 'col': 1, 'added': 1, 'end': 2}]

tells me I also need to insert line 2 from the current buffer before
line 2 in my plugin's version of the buffer.

Both read from the buffer in the current state, which means I end up
with two blank lines instead of a blank line followed by a line with a
single backtick

> Your loop has a clear problem, that if you get two changes, one deleting
> a line and one adding a line, then the l:change.type will get the last
> change type, which depends on the ordering, so that won't work.  The
> easiest would be to deal with each change separately. Thus just before
> the "endfor".

Thanks, there are I'm sure a few issues that need to be resolved given
my new understanding of the way things work :)

I think I've got an idea of how I should be handling this now.

Thanks again for your patience and taking the time to walk me through it.


Paul

-- 
-- 
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/CACoUkn6QkfqJ9XPiRG%2BSn0Jf%3D0B54rsiQcmFbjdT7fiCYum6YA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui