Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,11 @@
"description": "If enabled, dragging with the mouse activates Visual mode.",
"default": true
},
"vim.mouseSelectionGoesIntoVisualModeFromInsert": {
"type": "boolean",
"markdownDescription": "If enabled, dragging with the mouse activates Visual mode even when starting from Insert mode. Requires `vim.mouseSelectionGoesIntoVisualMode` to be true.",
"default": false
},
"vim.disableExtension": {
"type": "boolean",
"description": "Disables the VSCodeVim extension. The extension will continue to be loaded and activated, but Vim functionality will be disabled.",
Expand Down
1 change: 1 addition & 0 deletions src/configuration/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ class Configuration implements IConfiguration {
visualstar = false;

mouseSelectionGoesIntoVisualMode = true;
mouseSelectionGoesIntoVisualModeFromInsert = false;

changeWordIncludesWhitespace = false;

Expand Down
7 changes: 6 additions & 1 deletion src/configuration/iconfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,15 @@ export interface IConfiguration {
visualstar: boolean;

/**
* Does dragging with the mouse put you into visual mode
* Does dragging with the mouse put you into visual mode (except for insert mode)
*/
mouseSelectionGoesIntoVisualMode: boolean;

/**
* Does dragging with the mouse put you into visual mode when you're in insert mode
*/
mouseSelectionGoesIntoVisualModeFromInsert: boolean;

/**
* Includes trailing whitespace when changing word.
*/
Expand Down
3 changes: 2 additions & 1 deletion src/mode/modeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ export class ModeHandler implements vscode.Disposable, IModeHandler {
if (
configuration.mouseSelectionGoesIntoVisualMode &&
!isVisualMode(this.vimState.currentMode) &&
this.currentMode !== Mode.Insert
(this.currentMode !== Mode.Insert ||
configuration.mouseSelectionGoesIntoVisualModeFromInsert)
) {
await this.setCurrentMode(Mode.Visual);

Expand Down
1 change: 1 addition & 0 deletions test/testConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export class Configuration implements IConfiguration {
matchpairs = '(:),{:},[:]';
visualstar = false;
mouseSelectionGoesIntoVisualMode = true;
mouseSelectionGoesIntoVisualModeFromInsert = false;
changeWordIncludesWhitespace = false;
foldfix = false;
disableExtension = false;
Expand Down