VSCodeVim / VSCodeVim/Vim

mouseSelectionGoesIntoVisualMode from insert mode too

Open
#9,214 5 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
Currently, even when vim.mouseSelectionGoesIntoVisualMode is on, selecting with a mouse when being in an insert mode doesn't change it (see here). This is different than a default behavior in vim.

To Reproduce
Enter insert mode with i, then select with mouse in any file.

Expected behavior
vim should enter visual mode.

Additional context
As I understand it, the original plan was to implement full-on Select Mode (#5716), however, 4 years after #5842 was opened, I think it's the right time to declare PR bankruptcy there and address the issues in smaller scale.

Note: this issue is particularly annoying when working in jupyter notebooks, where each cell has a separate "mode" and it's difficult to track in which cell when selecting with mouse you'll be in an insert vs virtual modes.

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

Start at src/mode/modeHandler.ts around line 417 and reproduce the issue by entering insert mode with i before selecting text with the mouse. Trace the mode transition and verify that mouse selection enters visual mode when vim.mouseSelectionGoesIntoVisualMode is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.