[vim/vim] Appending text in visual block mode doesn't work properly when cursor is moved (#8288)

13 views
Skip to first unread message

Yegappan Lakshmanan

unread,
May 30, 2021, 12:50:31 PM5/30/21
to vim/vim, Subscribed

Describe the bug
When appending text in visual block mode, if the cursor is moved before the
start of the visual block, then incorrect text is inserted.

To Reproduce
Detailed steps to reproduce the behavior:

  1. Run vim --clean
  2. Add the following text to an empty buffer.
    aaa
    bbb
    ccc
  3. Execute the following commands:
    gg$2jAx

Expected behavior
The following lines are expected after the edit:
aaxa
bbxb
ccxc

But the following lines are present after the edit:
aaxa
bbba
ccca

The second and third lines are not correct.

Environment (please complete the following information):

  • Vim version 8.2.2911
  • OS: Ubuntu 21.04
  • Terminal: Gnome-terminal

Additional details:
A test for this is already added to the Test_visual_block_mode() function in test_visual.vim.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Yegappan Lakshmanan

unread,
May 30, 2021, 12:56:54 PM5/30/21
to vim_dev, reply+ACY5DGBZKDMYKWN23X...@reply.github.com, vim/vim, Subscribed
Hi,

On Sun, May 30, 2021 at 9:50 AM Yegappan Lakshmanan <vim-dev...@256bit.org> wrote:

Describe the bug
When appending text in visual block mode, if the cursor is moved before the
start of the visual block, then incorrect text is inserted.

To Reproduce
Detailed steps to reproduce the behavior:

  1. Run vim --clean
  2. Add the following text to an empty buffer.
    aaa
    bbb
    ccc
  3. Execute the following commands:
    gg$2jAx

As I didn't use the proper Github markdown, the special characters are not
shown here. The command to reproduce the bug is "gg$<C-V>2jA<Left>x<Esc>"
I have updated the issue in Github with the proper markdown now.

- Yegappan

vim-dev ML

unread,
May 30, 2021, 12:57:13 PM5/30/21
to vim/vim, vim-dev ML, Your activity

Hi,

On Sun, May 30, 2021 at 9:50 AM Yegappan Lakshmanan <
***@***.***> wrote:

> *Describe the bug*

> When appending text in visual block mode, if the cursor is moved before the
> start of the visual block, then incorrect text is inserted.
>
> *To Reproduce*

> Detailed steps to reproduce the behavior:
>
> 1. Run vim --clean
> 2. Add the following text to an empty buffer.
> aaa
> bbb
> ccc
> 3. Execute the following commands:
> gg$2jAx
>
>

As I didn't use the proper Github markdown, the special characters are not
shown here. The command to reproduce the bug is "gg$<C-V>2jA<Left>x<Esc>"
I have updated the issue in Github with the proper markdown now.

- Yegappan


>
>
> *Expected behavior*

> The following lines are expected after the edit:
> aaxa
> bbxb
> ccxc
>
> But the following lines are present after the edit:
> aaxa
> bbba
> ccca
>
> The second and third lines are not correct.
>
> *Environment (please complete the following information):*
>
> - Vim version 8.2.2911
> - OS: Ubuntu 21.04
> - Terminal: Gnome-terminal

Bram Moolenaar

unread,
Jun 29, 2021, 12:55:05 PM6/29/21
to vim/vim, vim-dev ML, Comment

Closed #8288 via 4067bd3.


You are receiving this because you commented.

Reply all
Reply to author
Forward
0 new messages