Browse Source

Fix `JObject`'s braces for colored display

pull/8/head
Anton Tarasenko 4 years ago
parent
commit
2155865d0e
  1. 10
      sources/Data/JSON/JObject.uc

10
sources/Data/JSON/JObject.uc

@ -616,10 +616,16 @@ public function string DisplayWith(JSONDisplaySettings displaySettings)
// Prepare delimiters using appropriate indentation rules // Prepare delimiters using appropriate indentation rules
// We only use inner settings for the part right after '{', // We only use inner settings for the part right after '{',
// as the rest is supposed to be aligned with outer objects // as the rest is supposed to be aligned with outer objects
openingBraces = "{";
closingBraces = "}";
if (innerSettings.colored) {
openingBraces = "&" $ openingBraces;
closingBraces = "&" $ closingBraces;
}
openingBraces = displaySettings.beforeObjectOpening openingBraces = displaySettings.beforeObjectOpening
$ "{" $ innerSettings.afterObjectOpening; $ openingBraces $ innerSettings.afterObjectOpening;
closingBraces = displaySettings.beforeObjectEnding closingBraces = displaySettings.beforeObjectEnding
$ "}" $ displaySettings.afterObjectEnding; $ closingBraces $ displaySettings.afterObjectEnding;
propertiesSeparator = "," $ innerSettings.afterObjectComma; propertiesSeparator = "," $ innerSettings.afterObjectComma;
if (innerSettings.colored) { if (innerSettings.colored) {
propertiesSeparator = "{$json_comma" @ propertiesSeparator $ "}"; propertiesSeparator = "{$json_comma" @ propertiesSeparator $ "}";

Loading…
Cancel
Save