VSCodeVim / VSCodeVim/Vim

Cursor position error when it is next to the inlay hint

Open
#8,141 3 comments 8 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 the cursor is next to the inlay hint, there is a 1 character error in the position:
simplescreenrecorder-2022-12-05_10 21 34
In the image above, the cursor incorrectly treats the colon in the inlay hint as a character and skips the space after the inlay hint.

In addition, this is the behaviour of the vim plugin when it is disabled.
simplescreenrecorder-2022-12-05_10 20 20

To Reproduce

  1. Install rust-analyzer extension
  2. Input code:
struct StructWithLongName {};
fn main() {
    let object = StructWithLongName {};
}

Expected behavior
A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.24.3
  • VSCode version: 1.72.2
  • OS: 5.10.154-1-MANJARO

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 cursor-position issue with the rust-analyzer example and compare behavior with the VSCodeVim plugin disabled. Trace the extension's cursor handling around inlay hints; done means the inlay hint's colon is not counted as a document character and the cursor no longer skips the following space.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.