See, that's what I meant by "missing something obvious", I actually thought the line just continued, I didn't realize it was ending there and wrapping back to the start. So yeah, it's just a matter of "if we reach the end of a line while scrolling, jump back to 0". I think I just confused everyone, sorry about that.
I'll try to take a look but I'll be pretty busy for the next week or so (as is everyone, I suppose), so may take a while.