diff --git a/PrettyJsonListeners.py b/PrettyJsonListeners.py index a3d91e0..e78364f 100644 --- a/PrettyJsonListeners.py +++ b/PrettyJsonListeners.py @@ -28,7 +28,7 @@ class PrettyJsonLintListener(sublime_plugin.EventListener, PrettyJsonBaseCommand class PrettyJsonAutoPrettyOnSaveListener(sublime_plugin.EventListener): - def on_pre_save(self, edit): + def on_pre_save(self, view): auto_pretty = s.get("pretty_on_save", False) - if auto_pretty: + if auto_pretty and "JSON" in view.settings().get('syntax'): sublime.active_window().run_command('pretty_json')