I found an issue with the VS Code Vim extension that causes the rendering of the current line to jump up and down as text is entered by the user. To recapitulate the issue, install the VScode Vim extension (version 1.17 through 1.26 [latest]) and do the following
- Open VS Code on a Mac and enable the VS Code extension (version 1.17 - 1.26)
- add a the following setting to your VScode Settings.json file:
"vim.insertModeKeyBindings": [ { "before": ["<space>", "_", "<space>"], "after": ["<space>", "<", "-", "<space>"], }, ], - Enter insert mode via any shortcut (e.g.
i,I,i,A, etc.) - Type a word and then press space
- When the space character is pressed, the current line will drop down by about half of a line-height and the cursor will jump backward 1-3 characters.
To illustrate the issue, in this screencast, I:
Open the latest version of VS Code (1.86.2), ensure that all extensions are disabled, and type the letter 'a' followed by a space (about 1 second between presses), and the result is exactly as expected: the letter
aappears followed by a space as they are typed.Next, after enabling the latest version of the Vim extension, I enter insert mode and type the letter
aand space as before. However, with VS Code Vim installed, the line that I'm typing jumps down and the cursor jumps back one character for about 1.5 seconds each time I press space.Finally, I disable the
vim.insertModeKeyBindingsand repeat the exercise, and the graphical artifact has gone away.
In the screencast I'm running the latest (as of this writing) versions of the VS Code and the VS Code Vim extension. However, this graphical artifact has existed on the Mac since the release of Vim Extension 1.17.
The problem seems macOS-specific. I cannot reproduce it on Windows.
So my question is this: How could an extension cause VS Code to render a line slightly lower than normal?