federomero / pretty-json

Atom plugin. Format JSON documents.
MIT License
93 stars 23 forks source link

Tries to prettify non-JSON files such as .cfg #76

Closed ianpaschal closed 6 years ago

ianpaschal commented 6 years ago

I've been having an ongoing issue with pretty-json attempting to fix non-JSON files such as .cfg files when I save them.

While more plugin options might be the answer (like being able to specify the plugin to only run on *.json), since the plugin is just called pretty-json it feels like this should be the default non-configurable behavior.

Here's what I'm seeing (this is just an example, also have this problem when manually editing .obj files as well).

screen shot 2018-03-01 at 15 21 40

lexicalunit commented 6 years ago

It should only attempt to format on save for files that are detected as JSON language grammar. Are you setting the language grammar to JSON when viewing .cfg and .obj files?

Do you know what version of pretty-json you have installed? I believe this was an issue in older versions (I can't quite remember for sure tho).

lexicalunit commented 6 years ago

I think I see the problem. I just released a new major version v2.0.0 which should take care of this issue for you.

ianpaschal commented 6 years ago

Yup! Thank you!