commit
26541438af
|
@ -5,10 +5,6 @@
|
||||||
],
|
],
|
||||||
"command": "pretty_json"
|
"command": "pretty_json"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"keys": ["ctrl+alt+shift+j"],
|
|
||||||
"command": "jq_query_pretty_json"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"keys": ["ctrl+r"],
|
"keys": ["ctrl+r"],
|
||||||
"command": "pretty_json_goto_symbol",
|
"command": "pretty_json_goto_symbol",
|
||||||
|
|
|
@ -5,10 +5,6 @@
|
||||||
],
|
],
|
||||||
"command": "pretty_json"
|
"command": "pretty_json"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"keys": ["super+ctrl+shift+j"],
|
|
||||||
"command": "jq_query_pretty_json"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"keys": ["super+r"],
|
"keys": ["super+r"],
|
||||||
"command": "pretty_json_goto_symbol",
|
"command": "pretty_json_goto_symbol",
|
||||||
|
|
|
@ -11,10 +11,6 @@
|
||||||
],
|
],
|
||||||
"command": "un_pretty_json"
|
"command": "un_pretty_json"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"keys": ["ctrl+alt+shift+j"],
|
|
||||||
"command": "jq_query_pretty_json"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"keys": ["ctrl+r"],
|
"keys": ["ctrl+r"],
|
||||||
"command": "pretty_json_goto_symbol",
|
"command": "pretty_json_goto_symbol",
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"value_separator": ": ",
|
"value_separator": ": ",
|
||||||
"keep_arrays_single_line": false,
|
"keep_arrays_single_line": false,
|
||||||
"max_arrays_line_length": 120,
|
"max_arrays_line_length": 120,
|
||||||
"pretty_on_save": false,
|
"pretty_on_save": true,
|
||||||
"validate_on_save": true,
|
"validate_on_save": true,
|
||||||
"brace_newline": true,
|
"brace_newline": true,
|
||||||
"bracket_newline": true,
|
"bracket_newline": true,
|
||||||
|
@ -19,9 +19,9 @@
|
||||||
"jq_binary": "jq",
|
"jq_binary": "jq",
|
||||||
"jq_errors": false,
|
"jq_errors": false,
|
||||||
"as_json":[
|
"as_json":[
|
||||||
"JSON",
|
"Packages/JSON/JSON.sublime-syntax",
|
||||||
"Sublime Text Commands",
|
"Packages/PackageDev/Package/Sublime Text Commands/Sublime Text Commands.sublime-syntax",
|
||||||
"Sublime Text Settingss",
|
"Packages/PackageDev/Package/Sublime Text Settings/Sublime Text Settings.sublime-syntax",
|
||||||
"Sublime Text Menu"
|
"Packages/PackageDev/Package/Sublime Text Menu/Sublime Text Menu.sublime-syntax"
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -131,7 +131,7 @@ class PrettyJsonBaseCommand:
|
||||||
return '\n'.join(lines)
|
return '\n'.join(lines)
|
||||||
|
|
||||||
def show_exception(self, region: sublime.Region = None, msg=str()):
|
def show_exception(self, region: sublime.Region = None, msg=str()):
|
||||||
sublime.status_message(f'[Error]: {msg}')
|
sublime.message_dialog(f'[Error]: {msg}')
|
||||||
if region is None:
|
if region is None:
|
||||||
sublime.message_dialog(f'[Error]: {msg}')
|
sublime.message_dialog(f'[Error]: {msg}')
|
||||||
return
|
return
|
||||||
|
|
|
@ -15,6 +15,7 @@ class PrettyJsonLintListener(sublime_plugin.EventListener, PrettyJsonBaseCommand
|
||||||
if any(
|
if any(
|
||||||
syntax in view.settings().get("syntax") for syntax in as_json
|
syntax in view.settings().get("syntax") for syntax in as_json
|
||||||
):
|
):
|
||||||
|
self.view = view
|
||||||
self.clear_phantoms()
|
self.clear_phantoms()
|
||||||
json_content = view.substr(sublime.Region(0, view.size()))
|
json_content = view.substr(sublime.Region(0, view.size()))
|
||||||
try:
|
try:
|
||||||
|
@ -32,4 +33,4 @@ class PrettyJsonAutoPrettyOnSaveListener(sublime_plugin.EventListener):
|
||||||
if any(
|
if any(
|
||||||
syntax in view.settings().get('syntax') for syntax in as_json
|
syntax in view.settings().get('syntax') for syntax in as_json
|
||||||
):
|
):
|
||||||
sublime.active_window().run_command('pretty_json')
|
sublime.active_window().active_view().run_command('pretty_json')
|
||||||
|
|
Loading…
Reference in New Issue