#66 ~ moving line and value separators into config file, so people can change it easily to value they need

This commit is contained in:
Nikolajus 2016-07-14 15:45:38 +02:00
parent 7e93346c86
commit dd72cbfc96
2 changed files with 13 additions and 6 deletions

View File

@ -1,6 +1,8 @@
{
"use_entire_file_if_no_selection" : true,
"indent" : 2,
"sort_keys" : false,
"ensure_ascii" : false
"use_entire_file_if_no_selection": true,
"indent": 2,
"sort_keys": false,
"ensure_ascii": false,
"line_separator": ",",
"value_separator": ": "
}

View File

@ -67,15 +67,20 @@ class PrettyJsonBaseCommand(sublime_plugin.TextCommand):
indent=s.get("indent", 2),
ensure_ascii=s.get("ensure_ascii", False),
sort_keys=s.get("sort_keys", False),
separators=(',', ': '),
separators=(s.get("line_separator", ","), s.get("value_separator", ": ")),
use_decimal=True)
@staticmethod
def json_dumps_minified(obj):
line_separator = s.get("line_separator", ",")
""":type : str"""
value_separator = s.get("value_separator", ": ")
""":type : str"""
return json.dumps(obj,
ensure_ascii=s.get("ensure_ascii", False),
sort_keys=s.get("sort_keys", False),
separators=(',', ':'),
separators=(line_separator.strip(), value_separator.strip()),
use_decimal=True)
def highlight_error(self, message):