fix: formatting and double quote removal

This commit is contained in:
TheSecEng 2020-04-16 17:40:48 -04:00
parent 9ca958dfc3
commit d1573b0e73
No known key found for this signature in database
GPG Key ID: A7C3BA459E8C5C4E
2 changed files with 6 additions and 7 deletions

View File

@ -3,7 +3,7 @@
"indent": 4,
"sort_keys": false,
"ensure_ascii": false,
"ensure_ascii": true,
"line_separator": ",",
"value_separator": ": ",
"keep_arrays_single_line": false,

View File

@ -327,7 +327,7 @@ class UnPrettyJsonCommand(PrettyJsonBaseCommand, sublime_plugin.TextCommand):
class JqPrettyJson(sublime_plugin.WindowCommand):
'''
Description: Allows work with ./jq
Description: ./jq integration
'''
def run(self):
@ -365,16 +365,15 @@ class JqPrettyJson(sublime_plugin.WindowCommand):
)
raw_json = self.get_content()
out, err = p.communicate(bytes(raw_json, "utf-8"))
out, err = p.communicate(bytes(raw_json, "UTF-8"))
output = out.decode("UTF-8").replace(os.linesep, "\n").strip()
if output:
view = self.window.new_file()
view.run_command("jq_pretty_json_out", {"jq_output": output})
view.set_syntax_file(json_syntax)
except OSError:
exc = sys.exc_info()[1]
sublime.status_message(str(exc))
except OSError as ex:
sublime.status_message(f'{ex}')
class JsonToXml(PrettyJsonBaseCommand, sublime_plugin.TextCommand):
@ -455,7 +454,7 @@ class PrettyJsonGotoSymbolCommand(PrettyJsonBaseCommand, sublime_plugin.TextComm
content = self.view.substr(sublime.Region(0, self.view.size()))
try:
json_data = self.json_loads(content)
self.generate_items(json_data, "")
self.generate_items(json_data, '')
sublime.active_window().show_quick_panel(self.items, self.goto)
except Exception as ex:
self.show_exception(region=None, msg=ex)