Fix scrolling long lines horizontally

This fixes #2745.