VSCodeVim / VSCodeVim/Vim

Yanking selection in visual block mode does not update `0` register

Open
#6,017 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug
Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

Describe the bug
In Vim, when you yank text, it updates the 0 (zero) register with the text you've yanked. In VSCodeVim, this behavior is broken for text selected in visual block mode (Ctrl+V); the 0 register is not updated.

To Reproduce
Steps to reproduce the behavior:

  1. Enter the text abc def in your editor, and move the cursor to the a and press Esc to enter "normal" mode.
  2. Type yw to yank the text abc using the w movement.
  3. Type w⎈vlly, where ⎈v represents Ctrl+V, to move to the text def, select it in visual block mode, and yank it.
  4. Type o⎈r0, where ⎈r represents Ctrl+r, to open a new line and paste the contents of the 0 register.

Expected behavior
The text def is pasted, which is what happens in Vim.

Actual behavior
The text abc is pasted.

Environment (please complete the following information):

  • Extension Name: vim
  • Extension Version: 1.18.5
  • OS Version: Darwin x64 19.6.0
  • VSCode version: 1.52.1
{
	"messages": [],
	"activationTimes": {
		"codeLoadingTime": 39,
		"activateCallTime": 0,
		"activateResolvedTime": 0,
		"activationReason": {
			"startup": true,
			"extensionId": {
				"value": "vscodevim.vim",
				"_lower": "vscodevim.vim"
			},
			"activationEvent": "*"
		}
	},
	"runtimeErrors": []
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Ctrl+V visual-block yank sequence in VSCodeVim and trace how yanks update the 0 register. Add coverage for the stated yw followed by visual-block y sequence, then verify that opening a line and pasting register 0 produces def rather than abc.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.