VSCodeVim / VSCodeVim/Vim

Unexpectedly entered visual mode in snippet

Open
#7,068 5 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
With a custom snippet, vscode enters visual mode when [tab] is pressed (to use the snippet)
This blocks further editing until [esc] and [i] is pressed to enter insert mode again.

To Reproduce

  1. Add the following custom snippet:
    ( How to use snippets: https://code.visualstudio.com/docs/editor/userdefinedsnippets )
{ // file: Buggy_Snippet.code-snippets
  "Snippet Test": {
    "prefix": "SnippetTest",
    "body": ["${1:default}", "${1}"],
    "description": "Snippet that triggers visual mode"
  },
}
  1. In vscode editor, open a file and type "snippettest" and wait/trigger suggestions. Select the appeared snippet and press [tab]/[enter] to use the snippet.
  2. Visual mode is triggered.

Expected behavior
Vscode should stay in insert mode.

Screenshots
image

Environment:

  • Extension (VsCodeVim) version: 1.21.7
  • VSCode version: 1.60.0
  • OS: macOS Big Sur version 11.1

About VSCode:
Version: 1.60.0
Commit: e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff
Date: 2021-09-01T10:54:53.442Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 20.2.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

Reproduce the issue in the VS Code editor using the provided Buggy_Snippet.code-snippets definition and the reported VSCodeVim and VS Code versions. Trace snippet expansion and the transition between insert and visual modes; done means pressing Tab or Enter to expand this snippet leaves the editor in insert mode and preserves further editing.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.