VSCodeVim / VSCodeVim/Vim

Selecting text in visual mode always highlights one additional character

Open
#8,827 2 comments 1 reaction 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 I select some text in visual mode, e.g. with viw (not with mouse), it always highlights one extra character/column to the right.

To Reproduce

  1. In normal mode, go to the first character of a word
  2. Enter visual mode by pressing v
  3. Press e

(The word is selected correctly, but the space after the word is also highlighted.)

Expected behavior

When selecting a word, I would expect something like the following:
visualmode1

But instead it highlights like this:
visualmode2


  • Extension (VsCodeVim) version: 1.27.2
  • VSCode version: 1.85.1
  • OS: Linux Mint 21.2 x86_64 (DE: Cinnamon)

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 VSCodeVim with the reported sequence: move to a word, press v, then e, and compare the selection with the expected behavior. Trace the visual-mode selection handling and any related tests; done means selecting the word no longer highlights the following space or column.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.