VSCodeVim / VSCodeVim/Vim

Failed to enter insert-mode if a snippet starts with a linked placeholder.

Open
#5,969 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

To Reproduce

See this simple snippet:

	"test": {
		"prefix": "test",
		"body": [
			"${1:some_placeholder}, $1" 
		],
	},

After typing "test" and expanded, vim enters visual mode instead of insert mode.

The bug occurs only if all 3 conditions below are met:

  1. The snippet must start with a placeholder. "blah blah ${1:some_placeholder} $1" works fine.
  2. The placeholder must be linked. "${1:some_placeholder} blah blah" works fine.
  3. It should be a placeholder, not a simple tabstop. "$1 blah blah $1" works fine.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.18.5
  • VSCode version: 1.52.1
  • OS: win10

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 supplied snippet in VSCodeVim and trace the snippet-expansion path into the insert/visual-mode transition. Done means a snippet beginning with a linked placeholder enters insert mode rather than visual mode, while the contrasting examples in the report continue to behave as described.

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.