Sync horizontal scrolling in changes view

simgunz 3 months ago • updated 3 months ago 1

In the changes view (within the log view), the horizontal scrolling should be synchronised also when the horizontal width of the two sides is different. Currently if one line in the right view is longer than any line in the left view, the horizontal scrolling of the two views is not properly synchronised.

(It can be seen also by the fact that the scroll bar in the right view is smaller than the one in the left view).

How do you think horizontal scrolling synchronizing should be properly implemented? Please note that
- multiple lines are shown and
- each line pair can have different lengths.

The total width (in terms of characters) of the two text views should be made equal to the longest line between the two views.

A stupid implementation can be filling  the last blank  line of both sides with as many spaces as max(char width left, char width right). Given that the font is monospace, now the two views will be in sync even if they have lines of different length (because the longest line with the spaces is the same length on both sides).

This last line should be somehow ignored in the comparison.

Probably better implementations are possible.

Also  it would be useful to have a option to enable text wrapping, to avoid the scrolling. Sometimes latex documents have very long single line that on the latex editor (e.g sharelatex) are wrapped, just to give a use case.