Clicking beyond EOL often enters Visual Mode or moves cursor to EOL character
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
Same as #3260 but still prevalent today.
When clicking beyond the end of line and accidentally dragging the cursor for a mere pixel during the click, it enters Visual Mode. Pressing x then deletes the newline character (and thus joins the lines together).
If vim.mouseSelectionGoesIntoVisualMode is false, it will still move the cursor beyond the end of line but will stay in Normal Mode. Pressing x in this case just moves the cursor back onto the last character.
Extremely annoying because clicking into the vscode window to focus it and move the cursor to a relevant position in one click is a very frequent action, at least for me.
To Reproduce
Steps to reproduce the behavior:
- Have text
- Click on the empty space beyond the end of line
- Drag the cursor a couple of pixels during the click
- See the cursor jump beyond the last character on the line
Expected behavior
The cursor should stay on the last character of the line until I drag the mouse enough to actually select some visible text.
Screenshots

Environment (please complete the following information):
- Extension (VsCodeVim) version: 1.25.2
- VSCode version: 1.76.0
- OS: Windows 11
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
Reproduce the behavior in VSCode with VSCodeVim using the reported versions and both values of vim.mouseSelectionGoesIntoVisualMode. Trace the mouse click and drag handling, then verify that clicks beyond a line end keep the cursor on the last character unless the drag selects visible text, without entering Visual Mode or joining lines with x.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100