improve edge case where font is inserted on a line that has subsequent whitespace after cursor