fix highlighting issues
correctly compute the available space in the main window
avoid splitting words when possible
fix the layout for long words

This makes sure that a word too long for the width of the screen when
starting at the first column will never be split.