GumTreeDiff / gumtree

An awesome code differencing tool
https://github.com/GumTreeDiff/gumtree/wiki
GNU Lesser General Public License v3.0
936 stars 174 forks source link

Synchronize scroll in webdiff view #260

Open algomaster99 opened 2 years ago

algomaster99 commented 2 years ago

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.

jrfaller commented 2 years ago

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.

algomaster99 commented 2 years ago

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.