Skip to content

Commit

Permalink
Fixes #1871
Browse files Browse the repository at this point in the history
  • Loading branch information
Chillee committed Jul 4, 2017
1 parent 5683239 commit 253905a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,11 @@
"description": "Uses a hack to move around folds properly",
"default": false
},
"vim.mouseSelectionGoesIntoVisualMode": {
"type": "boolean",
"description": "Does dragging with the mouse put you into visual mode",
"default": true
},
"vim.enableNeovim": {
"type": "boolean",
"description": "Use neovim on backend. (only works for Ex commands right now). You should restart VScode after enable/disabling this for the changes to take effect. NOTE: Neovim must be installed (v0.2.0) and neovimPath must be set the executable in order for this setting to work. Otherwise, vscodevim will crash.",
Expand Down
1 change: 1 addition & 0 deletions src/configuration/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ class ConfigurationClass {
*/
visualstar = false;

mouseSelectionGoesIntoVisualMode = true;
/**
* Uses a hack to fix moving around folds.
*/
Expand Down
6 changes: 5 additions & 1 deletion src/mode/modeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,11 @@ export class ModeHandler implements vscode.Disposable {
this._vimState.lastClickWasPastEol = false;
}

if (!this._vimState.getModeObject(this).isVisualMode) {
if (
!this._vimState.getModeObject(this).isVisualMode &&
(this._vimState.getModeObject(this).name !== ModeName.Insert ||
Configuration.mouseSelectionGoesIntoVisualMode)
) {
this._vimState.currentMode = ModeName.Visual;
this.setCurrentModeByName(this._vimState);

Expand Down

0 comments on commit 253905a

Please sign in to comment.