Skip to content

Commit

Permalink
Fixed stupid syntax highlighting bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Mondok committed Nov 20, 2015
1 parent ae9bbe9 commit 1bd7062
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jqui/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.5</string>
<string>1.0.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
12 changes: 8 additions & 4 deletions jqui/classes/JQViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

}

Expand Down

0 comments on commit 1bd7062

Please sign in to comment.