lite-formatters
lite-formatters copied to clipboard
Formatting file breaks history (undo/redo)
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.
Can you please send me a copy of the code you're trying to format?
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.
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