VSCodeVim / VSCodeVim/Vim

Marks for "previously operated or put text" don't work with yanked text

Open
#4,734 5 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 vanilla vim, if you yank text in visual mode, using `[ and `] afterwards will take you to the start and end positions of the yanked text. The vim docs call this out explicitly:

							*'[* *`[*
'[  `[			To the first character of the previously changed
			or yanked text.

							*']* *`]*
']  `]			To the last character of the previously changed or
			yanked text.

VSCodeVim claims to support these commands, but it does not seem to support yanked text.

To Reproduce

  1. Open a new file
  2. Enter insert mode and type:
line1
line2
line3
line4
  1. Exit insert mode and go to line 2
  2. Enter visual line mode (shift+v), select lines 2-3, and yank (y)
  3. Try using `[ (takes you to the start of line 1) and `] (takes you to the end of line 4)

Expected behavior

  • `[ - Should take you to the start of line 2
  • `] - Should take you to the end of line 3

(This is what happens for me when I follow the same steps on a vim 8.1.2292 with no vimrc)

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.13.1
  • VSCode version: 1.44.0
  • OS: macOS 10.15.4

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

Start by tracing the implementation of the [`` and ``] marks and the visual-line yank command described in the reproduction steps. Reproduce the issue with the four-line example, then verify that the marks select the start of line 2 and end of line 3 after yanking lines 2-3.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.