Better line length calculation, better selection view updating.