Estetic changes
This commit is contained in:
parent
a2b5b12bd5
commit
17df27bcbd
|
@ -4,6 +4,7 @@ import json
|
||||||
|
|
||||||
s = sublime.load_settings("Pretty JSON.sublime-settings")
|
s = sublime.load_settings("Pretty JSON.sublime-settings")
|
||||||
|
|
||||||
|
|
||||||
class PrettyjsonCommand(sublime_plugin.TextCommand):
|
class PrettyjsonCommand(sublime_plugin.TextCommand):
|
||||||
""" Pretty Print JSON
|
""" Pretty Print JSON
|
||||||
"""
|
"""
|
||||||
|
@ -14,7 +15,7 @@ class PrettyjsonCommand(sublime_plugin.TextCommand):
|
||||||
selection = sublime.Region(0, self.view.size())
|
selection = sublime.Region(0, self.view.size())
|
||||||
else:
|
else:
|
||||||
selection = region
|
selection = region
|
||||||
|
|
||||||
try:
|
try:
|
||||||
obj = json.loads(self.view.substr(selection))
|
obj = json.loads(self.view.substr(selection))
|
||||||
self.view.replace(edit, selection, json.dumps(obj, indent=s.get("indent_size", 4), ensure_ascii=False, sort_keys=s.get("sort_keys", True)))
|
self.view.replace(edit, selection, json.dumps(obj, indent=s.get("indent_size", 4), ensure_ascii=False, sort_keys=s.get("sort_keys", True)))
|
||||||
|
|
Loading…
Reference in New Issue