-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fantomas scrambled up a huge script file #34
Comments
Does your OS or editor keep intermediate copies or history? Undo in the editor? 3000 lines of work, you must have been taking snapshots?? |
Unfortunately, I set fantomas to format on save. And normally I do a lot of intermediate commits. Only, as bad luck has it, working on a recoding of my project putting everything in the huge script file, at almost the finish, the problem occurred. So, I am afraid, I have to do it all over. P.S. Normally, you "save" to save your work. In this case it destroyed my work. |
The least fantomas should do is check whether the formatted code is still syntactically correct. If it isn't syntactically correct do not format the code but leave it as it is. This could prevent the mess that happened to me. |
A couple questions that need to be answered:
|
This applies the minimal changes to the edit buffer. You should be able to hit undo unless you closed the file.
I say expression, because it doesn't appear to be on a line-by-line basis
|
I tried to undo, but that didn't result in a recovery. I did this before giving up and closing the file. |
@nojaf Do we check after formatting if the CodeFormatter produced a valid output? |
I don't think so for |
Unfortunately fantomas set up to run on save, scrambled a huge script file of mine. This has caused literally days of work loss.
Is there a way to recover from this?
Well, actually, I am quite distressed by all of this. This is causing me big problems!
The text was updated successfully, but these errors were encountered: