move cursor to the same position after formatting