Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The caret is moved to the end of file after the format command executed #1

Open
vasily-kirichenko opened this issue Apr 24, 2013 · 3 comments

Comments

@vasily-kirichenko
Copy link

It'd be nice if the caret keeps its original position in which it was before the formatting.

@dungpa
Copy link

dungpa commented Jun 8, 2013

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.

@vasily-kirichenko
Copy link
Author

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.

@dungpa
Copy link

dungpa commented Jul 1, 2013

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants