moving max line length into config so people can change it

This commit is contained in:
Nikolajus 2016-07-15 01:03:35 +02:00
parent 56145e950c
commit a054124590
3 changed files with 5 additions and 2 deletions

View File

@ -5,5 +5,6 @@
"ensure_ascii": false,
"line_separator": ",",
"value_separator": ": ",
"keep_arrays_single_line": false
"keep_arrays_single_line": false,
"max_arrays_line_length": 120
}

View File

@ -90,7 +90,7 @@ class PrettyJsonBaseCommand(sublime_plugin.TextCommand):
items = [a.strip() for a in m.split(line_separator.strip())]
replacement = join_separator.join(items)
# if line not gets too long, replace with single line
if len(replacement) <= 120:
if len(replacement) <= s.get("max_arrays_line_length", 120):
output_json = output_json.replace(m, replacement)
return output_json

View File

@ -71,6 +71,8 @@ http://stedolan.github.io/jq/
**keep_arrays_single_line** - false
**max_arrays_line_length** - 120
## Using tabs for indentation
You can change configuration key **indent** to string value "\t" or any other string