-
Notifications
You must be signed in to change notification settings - Fork 450
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
Can't save files after updating (if file formatting is not changed by Atom Beautify when saving) #1949
Comments
same! |
same , i have Beautify on Save option checked on Typescript |
same |
Same for C, C++ and Rust with Beautify on Save enabled. Works correctly when beautifying by hand before saving with the option disabled. |
same! |
Can you describe what happens when you try to save? Does it beautify and not save? Something else? Can you also confirm you are on Atom 1.21 or later? |
In my case the beautifying works, it's just that the file is not saved. As if atom-beautify prevents it. Because as soon as I disable the beautifying on save it works fine. |
@szeck87 Doing some tests with the Beautify on Save option enabled:
|
Can you check the console to see if it's throwing an error? |
Wether it works or not, I get the same warning:
However, I get a maybe more interesting error following these steps:
You then get the following error:
|
I see in the last commits there was a change to use the |
From what I can gather stepping through the code, is that the The 'will-save' event is emitted in a function called So if the formatter doesn't change the text, that prevents Atom from saving the file. |
Correct, there was a change. Before that change, it would save files twice: once after telling it to save, after it does that Atom Beautify beauties the file, then Atom Beautify saves it again. With the change last night, Atom waits for Atom Beautify to beautify the file, then saves. |
And indeed, adding
to that |
@exoticorn thanks for the findings. So in a nutshell, if you make changes to the file but in a way it's formatted properly (in which case Atom Beautify doesn't make changes), it fails. Correct? |
Yes exactly. The workaround (other than my temporary fix above) is to just insert a random space somewhere that gets removed by the formatter. Then the file saves correctly. ;) |
Bug related to #1924 I'm working on a fix right now. |
Please provide an example code so I can quickly reproduce and ensure the bug fix works. |
Reproduce:
|
Published the fix recommended by @exoticorn : #1949 (comment) Patch version 0.30.8 Please try and let me know! |
Sorry all, missed that use case when I made this change. Please test the fix @Glavin001 put out and let us know if there are any more issues. |
Cheers @Glavin001 ! Just updated and everything works great again - it saves with and without beautifying. No worries @szeck87 - we are, after all, only human. It's blazing fast tho. So I love the change :-) |
I get this error after updating, on Atom start:
Edit: After uninstalling and reinstalling the package, it works! Thanks! |
Update: Please try v0.30.9 cc @ejpcmac |
EDIT: I tried disabling this package and the issue is still there.. so nvm, seems to be issues with a different package. |
Ok @Glavin001, reinstallation made it work because I am now indeed at v0.30.9. Works great! Thanks again :) |
Can't save files after updating!
The text was updated successfully, but these errors were encountered: