Don't lose cursor position after strip trailing whitespace