Vim: Jittery motion when holding j/k/e/n down

Created on 28 Jul 2016  路  24Comments  路  Source: VSCodeVim/Vim

What did you do?

Open a file with enough text to fill a couple of screens. In normal mode, hold down any of kjen to move cursor multiple positions up/down/right/left.

What did you expect to happen?

Move cursor multiple positions in sequence, by the speed of the keyboard button repeat.

What happened instead?

Cursor sometimes jumps arbitrarily back and forth, jittery. Holding down normal arrow keys does not have this jittery motion, so seems related to extension.
Sometimes the problem is less noticeable, but it generally happens very often and is annoying enough that I resort to other motions. The gif does not capture the problem very well due to low fps, but it does show some of it.
2016-07-28_15-08-08

Technical details:

  • VSCode Version: 1.3.1
  • VsCodeVim Version: 0.1.4
  • OS: Win10 Home x64

Most helpful comment

FINALLY got this fixed. Turned out to be a weird sort of race condition.

All 24 comments

2016-07-28_15-12-31

en motions for right/left seems even worse, showcased in this gif.

Ran into the same issue the moment I received my Dell XPS 13. I thought it was my laptop keyboard's problem and imitated the issue by decreasing my System's keyboard repeat rate.

Now it looks like a racing problem. I'll put more info here if I get more ideas.

I am seeing the same with amvim extension. Possibly because both extensions use the same means to invoke these motions. I am not seeing this problem on my desktop PC, only on my laptop. It is a very powerful laptop with i7-6700 CPU, but the desktop is yet more powerful.

Decreasing keyboard repeat rate in Windows definitely helps, so seems like a racing issue for sure.

I think this is an API limitation (especially if amvim runs into the same problem), but I actually just had an interesting idea to try while thinking about it.

I actually don't encounter this bug on my computer, so I'll need you guys to test for me. I'll let you know.

It seems there may be a relevant API change in the recent 1.4.0 version:
https://code.visualstudio.com/updates#vscode

Extension Authoring: New 'move' commands to better support VIM gestures. Custom link behavior with the DocumentLinkProvider API. Expanded Debug Protocol.

Unfortunately no. The one we're interested would be disambiguate clicks from selection changes.

I've noticed the problem only happens when my enterprise network forces my computer to run a mcafee scan, which pegs the cpu. Running some program like prime95 that uses all of your cpu might help reproduce the issue.

I've given our keyboard processing logic quite a large overhaul, so I'd like to know if you guys notice any change in this annoying bug on master.

I had a similar issue on one of my machines. Tested out the master version and the jittery motion seems to have gone away.

The cursor experiences some minor lag when holding h/j/k/l down, but it's a significant improvement over the jittery motion.

Going to optimistically close this one. I'll reopen if anyone still has issues.

Nope still happening in the latest 0.4.0 on my dell xps 15.

image

I think it started happening again sometime around this commit, possibly this one. https://github.com/VSCodeVim/Vim/commit/41229871b11ae4164558538a3f26563a18856978

@johnfn per @mreishus 's info, you may want to take a look?

@rebornix I'm confused because all I did was _remove_ functionality in that commit.

@mreishus how did you determine it was that commit? Would you mind doing a git bisect?

I don't see this anymore on vscode 1.7.1 and vim 0.4.1

I still have it.

FINALLY got this fixed. Turned out to be a weird sort of race condition.

Please try out 0.4.8 (out now) and see if it fixes your problems. It seems to work for me, since the jitter on 0.4.7 was noticeable even on my computer. (I also wrote some code to introduce artificial latency into the code, still couldn't reproduce any jitter.)

Hi there!
I'm currently on 0.4.9 and still experiencing this issue. I've just installed, and so I'm not sure if there's a setting that I need to adjust to help with this issue?

Thanks!

I am on v0.7.0 and this has been happening to me. So I am not sure if there has been any updates. as soon as i disable vim plugin, every thing works smoothly.

@autoferrit Are you on mac?

I am on Xubuntu 17.04.
image

Running into this problem on Mac OS 10.13.4. I notice it when I use j or k to scroll/up down AND when I use the up/down arrow keys. Doesn't happen with h/l

Using
VSCode Vim: 10.13.4
Visual Studio Code: Version 1.23.1 (1.23.1)

Going to check issues on VSCode since this is happening with the arrow keys as well.

Edit:

I just tried disabling VSVim extension and the behavior went away. I noticed that the jitter seems to appear the longer I leave my editor open; so it's also possible it disappeared because I had to reload VSCode to disable the plugin.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gerardmrk picture gerardmrk  路  3Comments

cckowin picture cckowin  路  3Comments

orn688 picture orn688  路  3Comments

waltiam picture waltiam  路  3Comments

rajinder-yadav picture rajinder-yadav  路  3Comments