Closed Lucretiel closed 4 years ago
Apologies for the late response.
This can be fixed by basically reverting 002cef221c2a92a304c5a2763cb15db41b43c991. The change was made for simplicity and speed, but I just checked the plugin's performance on the longest file I could find in the Rust source (src/libcore/slice/mod.rs at the time of writing) and didn't observe any difference between the two methods. My apologies to everyone whose cursor position was being moved all these months, I should have kept that method.
I'm gonna test the change locally to find any potential gotchas. Just a heads up for now. Thanks for letting me know!
Just published 0.1.10
which once again uses the diffing method, minimizing cursor jumping. Let me know if this solves the issue or creates any new ones.
Should work, so I'm closing the issue for now. Please enjoy. 🙂
If I have the following code:
After formatting the file during a save, my cursor is moved to outside of the function body:
If possible, it would be nice if the location of the cursor could be preserved after a rustfmt.