Kittyfisto / Tailviewer

Open source log file viewer
https://kittyfisto.github.io/Tailviewer/
MIT License
186 stars 38 forks source link

Horizontal scroll bar doesn't always reflect the true width of the document being dispayed #235

Open Kittyfisto opened 4 years ago

Kittyfisto commented 4 years ago

Current behaviour

The horizontal scroll bar often reflects a range that is much greater than the actual width of the document being displayed. This can be seen by opening such a log file, scrolling horizontally to the right and then scrolling the entire document up & down. For several documents, not a single line will become visible, even though that is expected here.

Expected behaviour

Similar to the vertical scroll bar, the horizontal scroll bar should allow scrolling to the point where every single line can be fully seen, but not further than that.

Current implementation

At the moment, a very simple approach is used where every log file keeps track of the maximum number of characters per line for the file and the view then takes this number and multiplies it by the glyph width. Since Tailviewer only uses a monospace font to display log files, this yields a good enough result in most cases, but not in all. This problem will be exacerbated with #234 which changes the number of characters being displayed, completely breaking the previous assumption.

A new approach will have to be implemented.