VSCodeVim / VSCodeVim/Vim

Incorrect deletion of snippet linked placeholders

Open
#2,953 0 comments 5 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

Describe the bug
When a snippet has the same placeholder twice (e.g., two instances of ${1:tag}), after expanding the snippet and pressing the backspace/delete key, everything from the beginning of the first placeholder to the end of that line is deleted, and the second placeholder is unaffected.

To Reproduce
Create the following snippet for LaTeX:

"Create environment": {
	"prefix": "begin",
	"body": [
		"\\begin{${1:env}}\n\t$0\n\\end{${1:env}}"
	],
	"description": "Create a new environment"
}

Expand this snippet, then press the delete key. The result is the following (caret represents cursor positions):

\begin{|
    
\end{env|}

Expected behavior
Both ${1:env} placeholders are deleted, resulting in the following:

\begin{|}
	
\end{|}

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 0.16.0
  • VSCode version: 1.25.1
  • OS: macOS Mojave Beta

Additional context

  • LaTeX-Workshop version: 5.7.0

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 reproducing the issue with the LaTeX snippet containing two ${1:env} placeholders in VSCodeVim 0.16.0, then trace the extension's snippet placeholder deletion handling. Done means pressing delete removes both linked placeholders while preserving the surrounding LaTeX structure and caret positions.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, 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.