keep the cursor in the same line after beautification