Sublime Forum

Cannot save minified JSON in Build 4180

#1

When I open JSON, and then beautify it, then minify it and try to save it as it is (minified), it does not save the minified version but saves the beautified one.
I reverted to the previous version.

0 Likes

#2

Can you be more specific as to the plugins you’re using and what you mean by “does not save”?

0 Likes

#3

Well, as ST doesn’t manipulate content itself, when saving, it seems a plugin is involved which may suffer from a bug itself or behaves differently for some other reason.

We recently found “Pretty JSON” to suffer from a design bug, which caused trouble with auto-validation and auto-prettify on save. Maybe you suffer from something like that, too?

0 Likes

#4

Yes, that could be it. I have Pretty JSON installed.

Sublime saves the file, there is no problem with saving. But, if I minify the JSON file with Pretty JSON and try to save it in Sublime, the JSON on screen reverts to the unminifed version and Sublime saves it like that, unminified.

0 Likes

#5

I just saw that there is an update of Pretty JSON from yesterday. I upgraded Pretty JSON with that version and tried Sublime 4180 again, but the same thing still happens.

0 Likes

#6

Very likely you are suffering from Pretty JSON now correctly prettifying JSON file on save :smiley:

This didn’t work before due to a design fault.

The plugin prettifies JSON by default (see "pretty_on_save": true), when saving files.

I haven’t found a minify_on_save setting though.

0 Likes

#7

So now Pretty JSON actually works correctly? :smile: :smile:
I added "pretty_on_save": false and everything is back like it was.

Thanks!

0 Likes