gumtree icon indicating copy to clipboard operation
gumtree copied to clipboard

Synchronize scroll in webdiff view

Open algomaster99 opened this issue 3 years ago • 2 comments

I think it would be nice if scrolling either of the editors in monaco-diff view scrolled the other one by the same amount. For example, one can see how it is done in the monaco-native-diff view. There could be an API in Monaco for this or we can also write a custom script using JS for it.

algomaster99 avatar Jan 11 '22 15:01 algomaster99

Hi and thanks for the feedback!

Indeed it would be nice to have something to facilitate scrolling. However since I do not align files by putting white spaces for insertions / deletions, it would quickly be out of sync therefore we would need something something like a hotkey to activate parallel scrolling.

Not sure however what is the best way to do it.

jrfaller avatar Jan 11 '22 16:01 jrfaller

I found a lot of resources online when I looked for "JS synchronous vertical scrolling". One of them is https://stackoverflow.com/questions/30720926/how-do-i-make-two-divs-scroll-proportionally. I can have a look at this sometime and I shall keep you posted about what we can try.

algomaster99 avatar Jan 12 '22 09:01 algomaster99