Skip to content

Commit

Permalink
presenter: implicit check for dBlockInlineMap
Browse files Browse the repository at this point in the history
 * fixes #142
  • Loading branch information
flyx committed Mar 5, 2024
1 parent 48a90e3 commit cac1a3b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion yaml/presenter.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit cac1a3b

Please sign in to comment.