VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
13.9k stars 1.32k forks source link

Got a bug when using vscode shortcut Alt+mouseSelect #5177

Open syxbyi opened 4 years ago

syxbyi commented 4 years ago

Describe the bug VScode shortcut "alt+mouse_select" does not work correctly in insert mode

To Reproduce Steps to reproduce the behavior: For eg. in the following code block, I'd like to change the 3 "manualToPort" to "forceToPort" by only one operation. As far as I know, vim cannot do this. So I use vscode shortcut.

<div class='ui-grid-col-4'><label for='manualToPort'>my label</label></div>
<div class='ui-grid-col-8'><input pInputText id='manualToPort' [(ngModel)]='aps.manualToPorf'/></div>
  1. press "i" to switch to insert mode
  2. press and select the 3 words
  3. sometimes I can successfully select all of them and do things I want to, but most of time I cannot select anything, the cursor just move with my mouse without selecting items

Expected behavior work like if I unable VSCodeVim

Environment (please complete the following information):

my settings:

{
    "vim.easymotion": true,
    "vim.incsearch": true,
    "vim.useSystemClipboard": true,
    "vim.useCtrlKeys": true,
    "vim.hlsearch": true,
    "vim.insertModeKeyBindings": [
        {
        "before": ["f", "d"],
        "after": ["<Esc>"]
        }
    ],
    "vim.normalModeKeyBindingsNonRecursive": [
        {
            "before": ["leader", "v"],
            "after": ["<C-v>"]
        },
        {
            "before": ["<space>"],
            "after": ["i", "<space>", "<esc>", "<right>"]
        }
    ],
    "vim.leader": "<enter>",
    "vim.handleKeys": {
        "<C-a>": false,
        "<C-f>": false,
        "<C-x>": false,
        "<C-c>": false,
        "<C-v>": false,
        "<C-d>": true,
    },
    "editor.fontSize": 15,
    "editor.fontFamily": "'Source Code Pro', Consolas, Dengxian",
    // with im-select.exe -- auto unable Chinese input method in normal mode
    // "vim.autoSwitchInputMethod.enable": true,
    // "vim.autoSwitchInputMethod.defaultIM": "1033",
    // "vim.autoSwitchInputMethod.obtainIMCmd": "D:\\Program\\im-select.exe",
    // "vim.autoSwitchInputMethod.switchIMCmd": "D:\\Program\\im-select.exe {im}"
}
syxbyi commented 4 years ago

What's more, in normal mode, everything seems like well at the beginning, but:

  1. select the 3 places by pressing alt
  2. "x" and "i" to delete and insert
  3. use my key map "fd" to esc

Then I got:

Snipaste_2020-09-11_20-00-25

and I found that if I use instead of "fd" to back to normal mode, then everything goes right.

Finally, thanks for your plugin, it's very helpful. Hope you can pay some attention to this problem.