presenter: implicit check for dBlockInlineMap

* fixes #142
This commit is contained in:
Felix Krause 2024-03-05 18:37:55 +01:00
parent 48a90e36e8
commit cac1a3bd7c

View File

@ -541,7 +541,12 @@ proc startItem(
ctx.whitespace()
ctx.state = dBlockExplicitMapKey
else: ctx.state = dBlockImplicitMapKey
of dBlockInlineMap: ctx.state = dBlockImplicitMapKey
of dBlockInlineMap:
if kind != ikCompactScalar or ctx.options.explicitKeys:
ctx.append('?')
ctx.whitespace()
ctx.state = dBlockExplicitMapKey
else: ctx.state = dBlockImplicitMapKey
of dBlockExplicitMapKey:
ctx.newline()
t.write(repeat(' ', ctx.indentation))