Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remap of ["j", "j"] to "<Esc>" is no longer working #4787

Closed
gwintrob opened this issue May 3, 2020 · 12 comments · Fixed by #4791
Closed

Remap of ["j", "j"] to "<Esc>" is no longer working #4787

gwintrob opened this issue May 3, 2020 · 12 comments · Fixed by #4791

Comments

@gwintrob
Copy link

gwintrob commented May 3, 2020

Describe the bug

I remap pressing "j" twice to "Esc" in insert mode.

    "vim.insertModeKeyBindings": [
        {
            "before": [
                "j",
                "j"
            ],
            "after": [
                "<Esc>"
            ]
        }
    ],

This has worked perfectly for a long time. Starting today, when I press "j" twice in insert mode, I end up with one "j" and the cursor at the prior character in normal mode.

To Reproduce

  1. Add the insertModeKeyBindings setting above
  2. Hit "i" to enter insert mode and type something like "test"
  3. Hit "j" twice

Expected behavior

Screenshots

Here's a video. I updated "vim.debug.loggingLevelForConsole": "debug" but I'm not seeing anything in Output after restarting:

image

Environment (please complete the following information):

Extension version: 1.14.0
VS Code version: Code 1.44.2 (ff915844119ce9485abfe8aa9076ec76b5300ddd, 2020-04-16T17:07:18.473Z)
OS version: Darwin x64 19.4.0

Additional context

Thanks for such an important extension. I use it everyday!

@zerovolts
Copy link

This is also happening for me now when using jk/kj with v1.14.0 on Windows. It seems to occur every other time I use the combo (by repeating jkijki...).

@botforge
Copy link

botforge commented May 3, 2020

Yes! Same here! Definitely an issue with the latest update. Does anyone know how to install a rolled back version?

@bilalq
Copy link

bilalq commented May 3, 2020

Just ran into the same issue. You can workaround this by explicitly installing an older version of the extension either through the CLI or by searching for the extension in the IDE, hitting the gear icon, and selecting "Install Another Version".

Screen Shot 2020-05-02 at 7 42 22 PM

1.13.1 is fine and 1.14.0 is where the issue was introduced.

@benlindsay
Copy link

benlindsay commented May 3, 2020

Yep, I'm seeing the exact same thing. I recorded a video just to add to the context. I'm on a clean VSCode Insiders with no other extensions besides Vim, and I type "ijk" over and over, showing that it leaves behind a "j" every other time I do it.

vscode_vim_jk

And here's showing that it's fixed after reverting to the previous version:

vscode_vim_jk_fixed

@pak11273
Copy link

pak11273 commented May 3, 2020

If you don't want anymore "punch you in your face" surprises like this happening in the future. You might want to

"extensions.autoUpdate": false,
"extensions.autoCheckUpdates": false

in your settings.json

@suhailk16
Copy link

Hell No I even uninstalled vscode and deleted ~/Code folder to fix this.

@benjaminbenais
Copy link

Just ran into the same issue. You can workaround this by explicitly installing an older version of the extension either through the CLI or by searching for the extension in the IDE, hitting the gear icon, and selecting "Install Another Version".

Screen Shot 2020-05-02 at 7 42 22 PM

1.13.1 is fine and 1.14.0 is where the issue was introduced.

Thanks! Installing 1.13.1 fixed the issue for me.

@wsh3776
Copy link

wsh3776 commented May 3, 2020

Install 1.13.1 also works for me. Thanks!

@faustaleonardo
Copy link

Thank you 🕺

@J-Fields J-Fields self-assigned this May 3, 2020
@J-Fields J-Fields removed their assignment May 3, 2020
J-Fields pushed a commit that referenced this issue May 3, 2020
Fix insert mode key remaps leaving characters behind. This happened due to the new historyTracker optimizations, where we don't add the new characters one by one to history, but rather just the first one and then the rest at the end.
Fixes #4787
@gwintrob
Copy link
Author

gwintrob commented May 3, 2020

Woo hoo! Thanks @gergelyth, @J-Fields, and team.

@J-Fields
Copy link
Member

J-Fields commented May 3, 2020

This should be fixed in 1.14.1, which will be available momentarily. All credit goes to @gergelyth

@csuzdy
Copy link

csuzdy commented May 3, 2020

I can confirm, 1.14.1 fixed the issue for me.

berknam pushed a commit to berknam/Vim that referenced this issue May 5, 2020
Fix insert mode key remaps leaving characters behind. This happened due to the new historyTracker optimizations, where we don't add the new characters one by one to history, but rather just the first one and then the rest at the end.
Fixes VSCodeVim#4787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.