Marks for "previously operated or put text" don't work with yanked text
Nobody has claimed this yet.
- 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
- Open a new file
- Enter insert mode and type:
line1
line2
line3
line4
- Exit insert mode and go to line 2
- Enter visual line mode (
shift+v), select lines 2-3, and yank (y) - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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