printer yin BUGFIX use parent flag for when print

Fixes #1746
diff --git a/src/printer_yin.c b/src/printer_yin.c
index 93fd271..8883b68 100644
--- a/src/printer_yin.c
+++ b/src/printer_yin.c
@@ -377,12 +377,11 @@
 {
     int8_t inner_flag = 0;
 
-    (void)flag;
-
     if (!when) {
         return;
     }
 
+    ypr_close_parent(ctx, flag);
     ly_print_(ctx->out, "%*s<when condition=\"", INDENT);
     lyxml_dump_text(ctx->out, when->cond, 1);
     ly_print_(ctx->out, "\"");