VSCodeVim / VSCodeVim/Vim

Visual mode gets activated by accident when mouse clicking in the whitespace at the end of a line

Open
#8,824 2 comments 4 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
I often mouse click on the right side of a line, to quickly position the cursor where I want to edit. In most cases, I accidentally activate visual mode, because the mouse pointer needs to just move a single pixel to activate visual mode. It forces me to press Esc each time to get back to normal mode.

I know that entering visual mode by mouse can be disabled in settings, but I want to use this feature for text selection.

When clicking on text, the behaviour is fine, because visual mode only gets activated when dragging over a character boundary, not simply by moving a single pixel distance. The bug might have something to do with the invsible line ending character (just a guess).

To Reproduce

  1. Use a mouse, not a trackpad
  2. Start in normal mode
  3. Left-click somewhere to the right of a line of text and move the mouse pointer at least one pixel (horizontally), while still holding down the left mouse button
  4. Let go of the mouse button
  5. Notice that visual mode is now active

Expected behavior
I expect to have the cursor placed at the end of the line, still in normal mode.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.27.2
  • VSCode version: 1.85.1
  • OS: macOS 14.2.1

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

No file or test is named. Reproduce the mouse interaction in VSCodeVim using the reported VS Code, extension, and macOS versions, then trace the mouse handling involved; done means clicking and moving one pixel in line whitespace places the cursor at the line end without activating visual mode, while text selection still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
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.