Actually make 'trim whitespace' work without blowing up the cursor position.