[vim/vim] Fix changed_lines arguments in blockwise paste (PR #19844)

2 views
Skip to first unread message

Pierluigi Lenoci

unread,
6:08β€―AMΒ (12 hours ago)Β 6:08β€―AM
to vim/vim, Subscribed

Summary

When doing a blockwise paste beyond the end of the buffer, changed_lines() is called with an incorrect lnume argument. The third argument curwin->w_cursor.lnum includes the newly appended lines, but lnume should be "the first line below the changed lines BEFORE the change."

This fix subtracts nr_lines (the number of appended lines) from curwin->w_cursor.lnum, as suggested by @brammool in #6660.

Port of neovim/neovim#12733. Fixes #6660.

Changes

  • src/register.c: Fix the third argument to changed_lines() in blockwise paste from curwin->w_cursor.lnum to curwin->w_cursor.lnum - nr_lines
  • src/testdir/test_listener.vim: Add Test_listener_blockwise_paste() to verify the listener receives correct start, end, and added values when doing a blockwise paste that appends lines beyond the buffer end

You can view, comment on, or merge this pull request online at:

Β Β https://github.com/vim/vim/pull/19844

Commit Summary

  • 7026824 Fix changed_lines arguments in blockwise paste

File Changes

(2Β files)

Patch Links:

β€”
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19844@github.com>

Christian Brabandt

unread,
11:49β€―AMΒ (6 hours ago)Β 11:49β€―AM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19844)

thanks

β€”
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19844/c4143545123@github.com>

Christian Brabandt

unread,
11:56β€―AMΒ (6 hours ago)Β 11:56β€―AM
to vim/vim, Subscribed

Closed #19844 via 80a0c35.

β€”
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19844/issue_event/23977222056@github.com>

Pierluigi Lenoci

unread,
1:32β€―PMΒ (5 hours ago)Β 1:32β€―PM
to vim/vim, Subscribed
pierluigilenoci left a comment (vim/vim#19844)

@chrisbra, why thanks and then close it?

β€”
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19844/c4144168486@github.com>

Christian Brabandt

unread,
1:39β€―PMΒ (5 hours ago)Β 1:39β€―PM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19844)

Because I merged it

β€”
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19844/c4144204628@github.com>

Pierluigi Lenoci

unread,
4:04β€―PMΒ (2 hours ago)Β 4:04β€―PM
to vim/vim, Subscribed
pierluigilenoci left a comment (vim/vim#19844)

How strange, usually when PR is merged, it turns out to be merged. πŸ€”

β€”
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19844/c4144951370@github.com>

Pierluigi Lenoci

unread,
4:04β€―PMΒ (2 hours ago)Β 4:04β€―PM
to vim/vim, Subscribed
pierluigilenoci left a comment (vim/vim#19844)

However thank you πŸš€

β€”
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19844/c4144953518@github.com>

Reply all
Reply to author
Forward
0 new messages