Open mjbvz opened 1 year ago
I'm fine with reveal taking sticky scroll into account. The issue for markdown though is that this causes the viewports to get out of sync
When you scroll all the way down in the preview, the editor is still showing line 2 at the top of the editor. If you then switch over to the editor and scroll it, the preview instantly jumps back to show line 2 in the preview
@alexdima Do I need to use editor.stickyScroll.maxLineCount
to determine which range to reveal in the preview? Here's what I do today using the visible ranges event:
I think you're doing everything correct on your side, the problem here is that we went with the "cheap" implementation of sticky scrolling via an editor contribution. So the editor core doesn't really know that there is this thing at the top which hides certain lines by being rendered on top of them. That's why the visible ranges it emits also contain occluded lines. I'm sorry that I can't think of a straight-forward fix.
Bug Notice how the editor only scroll when you reach
h7
I believe this is happening because of this logic for sticky scrolling : https://github.com/microsoft/vscode/blob/39911aac41bc0fc65118ec91ecc918cc053be3de/src/vs/editor/browser/viewParts/lines/viewLines.ts#L683