#71 ~ way to turn off validation on save
This commit is contained in:
parent
3a3d95994d
commit
66c302caa4
|
@ -7,5 +7,6 @@
|
|||
"value_separator": ": ",
|
||||
"keep_arrays_single_line": false,
|
||||
"max_arrays_line_length": 120,
|
||||
"pretty_on_save": false
|
||||
"pretty_on_save": false,
|
||||
"validate_on_save": true
|
||||
}
|
|
@ -12,8 +12,9 @@ s = sublime.load_settings("Pretty JSON.sublime-settings")
|
|||
|
||||
class PrettyJsonLintListener(sublime_plugin.EventListener, PrettyJsonBaseCommand):
|
||||
def on_post_save(self, view):
|
||||
# will work only in json syntax
|
||||
if "JSON" in view.settings().get('syntax'):
|
||||
# will work only in json syntax and once validate_on_save setting is true
|
||||
validate = s.get("validate_on_save", True)
|
||||
if validate and "JSON" in view.settings().get('syntax'):
|
||||
self.view = view
|
||||
|
||||
self.view.erase_regions('json_errors')
|
||||
|
|
|
@ -80,6 +80,9 @@ http://stedolan.github.io/jq/
|
|||
**pretty_on_save** - false
|
||||
`do we need to automatically Pretty JSON on save`
|
||||
|
||||
**validate_on_save** - true
|
||||
`do we need validate JSON files on each save`
|
||||
|
||||
## Using tabs for indentation
|
||||
|
||||
You can change configuration key **indent** to string value "\t" or any other string
|
||||
|
|
Loading…
Reference in New Issue