Hey,
we've recently had this bug report in neovim. I've worked out a solution here, which I wanted to bring to your attention, since it concerns code shared between vim and neovim.
As written in the issue, I don't think it's a bug in vim, but rather a misleading comment: The comment of changed_lines says
"lnume" the first line below the changed lines (BEFORE the change)
while in this specific instance (blockwise paste at the end of the buffer) it gets called with a number larger than that. It does not seem to be a problem, since I think changed_lines in vim only registers the lines for redrawing, and that is robust against putting in too large numbers. It manifests as a bug in neovim since we're using changed_lines to read those lines from the buffer, so we really need the exactly right number here.
So, maybe you want to straighten that out in vim's code as well. Any comments on the validity of my fix or analysis are very welcome, too, of course :)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
I wonder, does it work to do:
changed_lines(lnum, 0, curwin->w_cursor.lnum - nr_lines, nr_lines);
It's a bit simpler.
That would work out it before the paste curwin->w_cursor.lnum is the same as curbuf->b_op_start.lnum. Is that a reasonable assumption? I thought about :put, but that's always linewise, but might there be other cases? Otoh, the cursor is always moved down y_size lines, so the code does some to assume this anyways.
ping?
Can someone turn this into a pull request?
Hi @KillTheMule I'd like to work on this issue. Is it still open?"
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I only fixed it on the neovim side, not sure what the status is at vim's side.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
oh okay , no problem .
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
So you should be able to take the Neovim patch and port it to Vim if you want to contribute.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
okay for sure i'll try that .
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()