unify visual line handling
Merge pull request #5803 from Carreau/ulh

unify visual line handling