Visual mode gets activated by accident when mouse clicking in the whitespace at the end of a line
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
- Use a mouse, not a trackpad
- Start in normal mode
- 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
- Let go of the mouse button
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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