From 2d4746b56c46c66cf2e16ac1c129e91fe6820859 Mon Sep 17 00:00:00 2001 From: Felix Krause Date: Mon, 11 Jan 2016 20:58:24 +0100 Subject: [PATCH] No newlines in explicit flow maps for ypsMinimal --- private/presenter.nim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/private/presenter.nim b/private/presenter.nim index 367fd13..498736b 100644 --- a/private/presenter.nim +++ b/private/presenter.nim @@ -62,8 +62,9 @@ proc startItem(target: Stream, style: YamlPresentationStyle, indentation: int, target.write(": ") state = dBlockMapValue of dFlowExplicitMapKey: - target.write('\x0A') - target.write(repeat(' ', indentation)) + if style != ypsMinimal: + target.write('\x0A') + target.write(repeat(' ', indentation)) target.write(": ") state = dFlowMapValue of dFlowMapValue: @@ -76,7 +77,8 @@ proc startItem(target: Stream, style: YamlPresentationStyle, indentation: int, target.write(", ") state = dFlowImplicitMapKey of dFlowMapStart: - if isObject or style in [ypsJson, ypsCanonical]: + if (isObject and style != ypsMinimal) or + style in [ypsJson, ypsCanonical]: target.write("\x0A" & repeat(' ', indentation)) if style != ypsJson: target.write("? ")