-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
feat(scrolling): sync neovim scroll with vscode #993
base: master
Are you sure you want to change the base?
Conversation
Thank you so much for continuing to work on this!! I've found a few issues with the WIP, but I'm sure you are aware and are continuing to work at it. Please let me know if there is anything you want me to test! I'll let you work on this and focus on some other tasks for now. |
@theol0403 I think this is mostly stable if people don't use code folding as that would mess up height computation. I made it so that mouse related events (clicking, scrolling by mouse wheel, scrolling by clicking on scrollbar, scrolling by dragging minimap) to be as close to vanilla vscode experience as possible. I'll be using it at work next week for discovering bugs. It'll be great if you can try it out as well. |
1ded40d
to
b999b8b
Compare
…when scrolling_viewport
55ab518
to
477c4d4
Compare
Update on folding: I created a new branch dealing with code folding: https://github.com/vscode-neovim/vscode-neovim/tree/experimental-scroll-fold However, this branch suffers from multiple issues:
Possible fixes:
Status: cannot implement the first solution due to upstream issue: microsoft/vscode#81498. Guess we will not support folding until this is resolved. |
@zbw8388 these updates look very promising! I've been trying out your PR. However, I've been experiencing problems with two-way sync enabled. Vscode -> neovim disabled: Vscode -> neovim enabled: Let me know if you want any help reproducing this! |
I've found that increasing the 20ms delay to 100ms almost fixes the problem for me. Perhaps this is a workaround that can be removed? Edit: |
Yeah I can reproduce this scrolling bug. I always had I also imagine other issues will pop up due to this weird behavior such as going to definition-induced scroll.
I read through VSCodeVim/Vim#1552. They use multiple chained vscode-side window scroll commands to fix this issue, which would probably also cause animation issue. Another thing is that both solutions introduce vscode scrolling logic, which we would like to get rid of in the first place, so I think opting for them might be a bit extra. I might not have time for at least this week to work on this. Feel free to work on it though! I also found a couple bugs that needs to get addressed:
|
Thanks for all the great info! Yeah, that is a bit dumb. Unfortunately, there is still a bit of trouble with smooth scrolling w/ two-way (occasional jitter, although correct end pos), and scrolling with the mouse is still sometimes jittery even with 200ms delay (the momentum gets stopped). Requiring no smooth scrolling might be a concevable compromise. All good about being busy! You've already done so much. I'll see what I can improve when I have a chance, but the techincal bits feel a bit beyond me currently. No rush to get this shipped. I might even release master as-is, because the only bug is lightspeed being broken immediately after C-u/C-d. |
Try the latest commit and see if it solves the issue :) Maybe it'd be better to look at config prior to changing setting that timeout (but who would scroll by mouse in 126ms after clicking on their keyboard?) I would be a bit hesitant to release master now, as it involves (I think) a major change to user experience, and we are expecting another change once this PR is ready. Maybe one way to do it would be excluding 29233d5 for releasing until we are fixed on how people scroll stuff |
That seems to fix the issue with C-u/C-d! I'm still running into the momentum clamping with mouse scroll, but it is better. Sounds good about the release! |
@zbw8388 @theol0403 I use these two shortcuts all the time when comparing diffs, so it was easy for me to spot: |
@wenfangdu this PR has not been merged yet. I was referring to #885 and #919. Either way, nothing merged in master should affect those commands. |
@theol0403 I did a commit bisect, the code from #919 caused that issue. |
@zbw8388 Currently the release is in a weird place because there were the first scrolling PRs that were merged but this one fixes them, so I can't release without this. I might make a hotfix release for the other PRs though. This PR has a lot of potential so I would love to see it merged. If not, it will be a while until I can try to tackle it myself. Thanks! |
Hi! I'm sorry about the inactivity. I'm super busy these days but I always wanted to finish this PR. It's hard to find a large chunk of time currently. I remembered I was dealing with a VSCode API limitation last time I was working on this. I might be able to look at it in November but it depends. Please release a hotfix if this is currently blocking the development! At the same time, I'm wondering if it would be possible to revert and split the merged scrolling modification commit into an individual branch so that normal development can still happen. |
@zbw8388 thanks for the reply! I totally understand, especially regarding finding a large chunk of time to work on it lol. This project is not the kind of project you can expect to make significant progress with two-hour chunks. I've released all pending PRs and have put the commits holding up development back in master (sync viewport, delete c-u). I imagine I won't have time to make many more PRs until december so hopefully this lines up with this PR being complete. I've gone ahead and merged master back into this PR, to reduce friction for you to get started when you have time. I modified a bit of code doing so, but if you don't like the changes I don't mind if you change it back. |
1d74bdd
to
6dc9acb
Compare
hi guys, great work here, any updates on this? |
These look somewhat related – #1131 (comment) |
Hey everyone don't want to pressure the awesome people working on this but I would LOVE to see this happen. 🙇♂️ |
We already set the selection based on the neovim cursor, but we should also scroll so that it's visible. This might be better fixed by something like vscode-neovim#993 but for now it makes :help work a lot nicer.
I discovered this extension recently and I find it way better than the Vim extension - thanks for the awesome work! Any updates with this? I would like to remap to zz and to zz |
Just wanted to check, would there be an update to make the scroll with folds work. It is a major issue in my workflow and navigating folds if they open automatically is a pain. Otherwise the extension is fantastic!!! |
This is a nice workaround for now, shouldn't expand folds unless you land directly on them. Remove the centred scrolling if not needed. If you don't want to install a separate extension you can use this solution, but adapt the jump by halfPage to wrappedLine |
See #983 for more discussion.
This PR takes the first approach in that issue to fix content scrolling. Creating this PR to link issue and branch together.
Tracking:
Legend:
not planned(good to have) merge set cursor with the lua as winrestview natively support themsupport folding