vscode-sync-scroll icon indicating copy to clipboard operation
vscode-sync-scroll copied to clipboard

Feature Request: Proportional Scrolling

Open moxwel opened this issue 3 years ago • 1 comments

I would be interesting and useful if the scrolling sync was proportional to the number of lines of each file.

For example: A file with 100 lines and other file with 50 lines in a split panel.

The behavior would be something like this: If in the first file I scroll to the line 50, the other file should be on line 25. And so...


I don't know exactly how to code extensions in VSCode, but it would work something like this in this pseudocode:

linesFileA = getLines(fileA)
linesFileB = getLines(fileB)

percentLineA = currentLine(fileA) * 100 / linesFileA

syncLineB = linesFileB * percentLineA / 100

setPosition(fileB, syncLineB)

And the same the other way around.

I know that's not how VSCode extensions works, but I hope the idea is understandable ^^"

moxwel avatar Mar 23 '21 23:03 moxwel

@moxwel Thanks very much for this idea and yes I think it's very clear and useful. I will add this as another todo task.

dqisme avatar Apr 03 '21 21:04 dqisme