question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Viewport scrolling issue with C-d/C-u

See original GitHub issue

I noticed that @zbw8388 made a branch on their fork that made me realize a bug I missed when merging #919 and #885 - when scrolling with C-u/C-d, the veiwport is wrong.

This is because neovim internally scrolls the content while using C-u, so that the cursor position stays the same relative to the window. However, vscode moves the cursor and does not scroll the content. This causes the viewport to be unsynced.

I can think of three solutions:

  • sync neovim scroll with vscode. This could be done with win_viewport, or winsaveview. This would also remove the need for a custom implementation of C-e/C-y/zt/zb/zz. I believe @asvetliakov said this could cause jitter, but we can try.
  • modify vscode scrolling strategy. There might be a vscode api option where moving the cursor long distances will scroll the content instead of moving the cursor
  • modify neovim scrolling strategy. Make neovim scroll how vscode does, which only scrolls the content if needed

I think the first option is ideal, if it doesn’t rely on too much code.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:5
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
tobealivecommented, Jul 31, 2022

As vscode is generally a bit troublesome with keyboard scrolling, I wrote a plugin recently that I think works fairly well. Maybe it also improves the experience for others who use vscode-neovim until there is a final implementation and solution. https://github.com/tobealive/german-scroll.code

And so great to see the skyrocketing development in recent days. I think slowly but steady, you make it better than the VSCodeVim extension 😊

1reaction
theol0403commented, Jul 31, 2022

@zbw8388 thanks for working on this too!

I vote that we let neovim handle all scrolling. This will let us remove all custom scrolling implementations (zz, C-e, etc). I think that switching to neovim-like behaviour where the content is scrolled instead of the cursor is a good feature.

I’m not sure if the jumplist note is relevant, but we should see if we can work around that if it is an issue. It might be worth it to look into if we can use neovim jumplist again (and also support jumplist from outline view).

If we can remove jitter, and let neovim handle all scrolling, that would be ideal.

I’m not very experienced with synchronization, but it seems like you are quite good with that!

I’m a little lost as to how to fix the current issues in my branch. Your branch (with a few tweaks from mine) seems to work very well to fix the original issue, but mine seems to have a lot of bugs (jitter, incorrect scrolling, etc). I think implementing a lock like you said would be a good next step.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cdk virtual scrolling issue - angular - Stack Overflow
First you need the Viewport Reference: @ViewChild(CdkVirtualScrollViewport, {static: false}) cdkVirtualScrollViewport: CdkVirtualScrollViewport;.
Read more >
cdk-virtual-scroll-viewport does not handle css position: sticky ...
I have been somewhat successful in getting around this issue by forcing translateY(0) and then creating a component with height: Xpx at the ......
Read more >
Card Settings | DCU - Digital Federal Credit Union
From the app: Select the account your card is linked to, and choose "Card Settings" from the side-scroll options menu under Account Services....
Read more >
Clark Shuttle - Transportation
After investigating the issue, it was determined the cause was related to a new driver just learning the route. ... View All Updates...
Read more >
smooth scaling of bitmaps - Page 3 - VCL - Delphi-PRAXiS [en]
The new .dcu file for GR32_Image.pas is in the debug folder. But I am not seeing any change in the scrolling - still...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found