diff --git a/jqui/Info.plist b/jqui/Info.plist index a1c2948..7dc991b 100644 --- a/jqui/Info.plist +++ b/jqui/Info.plist @@ -38,7 +38,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.5 + 1.0.6 CFBundleSignature ???? CFBundleVersion diff --git a/jqui/classes/JQViewController.swift b/jqui/classes/JQViewController.swift index 606b239..c576829 100644 --- a/jqui/classes/JQViewController.swift +++ b/jqui/classes/JQViewController.swift @@ -71,10 +71,14 @@ class JQViewController: NSViewController { return } - let output = _queryRunner.runTask(inputText, query: query) - let js = JSONSyntaxHighlight(JSON: output) - - jqOutputTextView.textStorage?.setAttributedString( js.highlightJSON()) + var output = _queryRunner.runTask(inputText, query: query) + if JQJsonUtils.isValidJson(output){ + output = output.stringByReplacingOccurrencesOfString("\n", withString: "") + let js = JSONSyntaxHighlight(JSON: JQJsonUtils.prettyPrint(output)) + jqOutputTextView.textStorage?.setAttributedString( js.highlightJSON()) + } else { + jqOutputTextView.string = output + } }