Enhancement: Cursor now returns to old position after removing trailing whitespaces on write.