From b2cf6d0af45e90542edf220fcbfadc69e4c518d1 Mon Sep 17 00:00:00 2001 From: ChAoS_UnItY Date: Wed, 5 Apr 2023 16:22:36 +0800 Subject: [PATCH] cgen: fix wrong indent generation in anon fn decl (#17879) --- vlib/v/gen/c/fn.v | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vlib/v/gen/c/fn.v b/vlib/v/gen/c/fn.v index c6645ba4eb..18ab03183a 100644 --- a/vlib/v/gen/c/fn.v +++ b/vlib/v/gen/c/fn.v @@ -379,6 +379,11 @@ fn (mut g Gen) gen_fn_decl(node &ast.FnDecl, skip bool) { } prev_inside_ternary := g.inside_ternary g.inside_ternary = 0 + prev_indent := g.indent + g.indent = 0 + defer { + g.indent = prev_indent + } g.stmts(node.stmts) g.inside_ternary = prev_inside_ternary if node.is_noreturn {