From 2155865d0ee94d7330f12fb12a2ac0c8c2c8c785 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Mon, 27 Jul 2020 22:35:13 +0700 Subject: [PATCH] Fix `JObject`'s braces for colored display --- sources/Data/JSON/JObject.uc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sources/Data/JSON/JObject.uc b/sources/Data/JSON/JObject.uc index 58e2795..a6bdc12 100644 --- a/sources/Data/JSON/JObject.uc +++ b/sources/Data/JSON/JObject.uc @@ -616,10 +616,16 @@ public function string DisplayWith(JSONDisplaySettings displaySettings) // Prepare delimiters using appropriate indentation rules // We only use inner settings for the part right after '{', // as the rest is supposed to be aligned with outer objects + openingBraces = "{"; + closingBraces = "}"; + if (innerSettings.colored) { + openingBraces = "&" $ openingBraces; + closingBraces = "&" $ closingBraces; + } openingBraces = displaySettings.beforeObjectOpening - $ "{" $ innerSettings.afterObjectOpening; + $ openingBraces $ innerSettings.afterObjectOpening; closingBraces = displaySettings.beforeObjectEnding - $ "}" $ displaySettings.afterObjectEnding; + $ closingBraces $ displaySettings.afterObjectEnding; propertiesSeparator = "," $ innerSettings.afterObjectComma; if (innerSettings.colored) { propertiesSeparator = "{$json_comma" @ propertiesSeparator $ "}";