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

Cursor jumps erratically before moving vertically #2163

Closed
Aetf opened this issue Nov 21, 2017 · 7 comments · Fixed by #2867
Closed

Cursor jumps erratically before moving vertically #2163

Aetf opened this issue Nov 21, 2017 · 7 comments · Fixed by #2867
Labels

Comments

@Aetf
Copy link

Aetf commented Nov 21, 2017

  • Click thumbs-up 👍 on this issue if you want it!
  • Click confused 😕 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Environment:

  • VSCode Version: 1.18.1
  • VsCodeVim Version: 0.10.4
  • OS: Archlinux

What happened:
When using a count prefix before vertical moving (j,k), the cursor jumps erratically before moving to target position, as shown in the screencast (the actual rate is much faster than it's shown in gif due to fps limit):

record

The commands I used were, in order: 500j, 200k, 50j, 10k, 5j, gg. It seems that the time the cursor spent jumping around is roughly proportional to the number of lines it should move pass.

Probably related: #1682, #1154. I tried both with and without neovim integration, but no change. Also since I'm not on mac, the mac setup mentioned in those two reports doesn't apply.

What did you expect to happen:
Cursor moves to target line directly, without any jumping, like what happens for gg

How to reproduce it:
Open any file with sufficient lines, and move cursor vertically by using number prefix {count}j or {count}k

@Chillee
Copy link
Member

Chillee commented Nov 21, 2017

@Aetf do you have foldfix turned on?

@Aetf
Copy link
Author

Aetf commented Nov 21, 2017

Yeah, you are right. Turning off foldfix solves this... But I do want the behavior when foldfix is on: moving pass a folded code block doesn't expand it.

@Chillee
Copy link
Member

Chillee commented Nov 21, 2017

@Aetf that's because foldfix is a really jank solution. Check microsoft/vscode#22276 for discussion on api limitations.

@Aetf
Copy link
Author

Aetf commented Nov 21, 2017

I see. Thanks for the info. From the pull request that introduces the foldfix, it sounds like this kind of jumping is by design 😟

I'm completely unfamiliar with the internals, but is it possible to interpret {count}j as one jumping down {count} lines operation rather than repeat j for {count} times? Or at least only do the jumping around test once, i.e. make the overhead constant rather than O(n) ?

@Chillee
Copy link
Member

Chillee commented Nov 21, 2017

@Aetf yeah the jumping down has to be done as we have no other way to interact with folds :/

I'm not actually sure why it jumps around like that. I don't think it should. It should definitely be possible to fix, just a question of finding time for it.

@caogit
Copy link

caogit commented Mar 15, 2023

So the problem hasn't been solved by now?

1 similar comment
@caogit
Copy link

caogit commented Mar 15, 2023

So the problem hasn't been solved by now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants