Hmm you're right.
However I think looping over visible lines only will cause weird behavior e.g. Jumping left horizontally when scrolling away from the longest line.
I added longest_line_length to the drawcache instead.
I tried updating this diff but it kept forcing me to create a new revision.
The updated result of "git diff" is attached.
This patch measures length in bytes which doesn't work properly w/ multi-byte characters, try paste this into the text editor for eg:
We could apply the patch with this as a known limitation, or calculate the length with BLF_width which is much more expensive (don't think it's worth it).