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

Formatting file breaks history (undo/redo) #34

Open
panbroggi opened this issue Apr 16, 2024 · 3 comments
Open

Formatting file breaks history (undo/redo) #34

panbroggi opened this issue Apr 16, 2024 · 3 comments

Comments

@panbroggi
Copy link

I am editing (mostly) julia files. I noticed that formatting a file with Alt+shift+R breaks the history of file modifications, accessible with undo/redo.
This is particularily unpleasant when formatting an unsaved file, since it is not possible to recover the unsaved edits.

@PerilousBooklet
Copy link
Collaborator

Can you please send me a copy of the code you're trying to format?

@panbroggi
Copy link
Author

Here is a working example. If you create a file with this content:

a = 1+1
println( "Hello world!")

and save the file ctrl+s. Now press alt+shift+f, it will be formatted to

a = 1 + 1
println("Hello world!")

correctly. However, if you press ctrl+z the file won't revert to the previous stage.
I noticed that if you don't save the file, you can revert.

@vincens2005
Copy link
Owner

This is because the formatter formats the file in place, so it has to be saved to format, and when it's reloaded the history is lost. Perhaps I should fix this

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

3 participants