VSCodeVim / VSCodeVim/Vim

`gi` goes to incorrect position after brace completion

Open
#6,204 5 comments 0 reactions 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
The position where gi goes to insert is slightly off, if the last insert had brace completion: it is after the brace, also if exit insert mode is done within the brace.

To Reproduce
Steps to reproduce the behavior:

  1. Goto insert mode
  2. type: foo('bar') and exit insert mode after "r" from bar. Cursor should be on r.
  3. you need brace completion, so that ') is inserted by vscode
  4. use "gi": it will start the insert after ")"

Expected behavior
Insert should start after "r"

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 sequence in VS Code with brace completion enabled: insert foo('bar'), exit after the r, then invoke gi. Trace the gi handling and cursor position used after insert mode exits; done means gi begins insertion after the r rather than after the automatically inserted closing brace.

Written by the indexing model from the issue text.

Assessment

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