Open vasily-kirichenko opened 11 years ago
I think there is no way to find out the updated position of the caret in the formatted text.
We can only keep the caret at the absolute position or scale its position linearly according to the length of formatted text.
I think it'd be fine if we keep the caret inside the code block / expression the caret was in before formatting, because in case of full file / big code block formatting, the code may be reordered significantly and keeping absolute position of the caret is meaningless.
@vasily-kirichenko Finding out new caret positions is tricky. At the moment, I scale caret positions based on line numbers. I keep your suggestion in mind and implement it when it is feasible.
It'd be nice if the caret keeps its original position in which it was before the formatting.