# zig fmt: fix extra newline before if nested in for · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/b4db03d8bb29f0cded857300df460b4247e85670)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: b4db03d8bb29f0cded857300df460b4247e85670

Requested commit: b4db03d8bb29f0cded857300df460b4247e85670

Commit: b4db03d8bb29f0cded857300df460b4247e85670

Tree: 57d801b9efa60deaa615c16a1c3a6db0604e46bd

Author: Lewis Gaul

Committer: Isaac Freund

## Message

```
zig fmt: fix extra newline before if nested in for

Add failing testcase to reproduce issue 8088

Tidy up renderWhile(), factoring out renderWhilePayload()

Ensure correct newline is used before 'then' token in while/for/if

Handle indents for 'if' inside 'for' or 'while'

Stop special-casing 'if' compared to 'for' and 'while'

```

## Parents

- [a502c160cd51ce3de80b3be945245b7a91967a85](https://git.cafe/gitcafe/zig/commit/a502c160cd51ce3de80b3be945245b7a91967a85?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/b4db03d8bb29f0cded857300df460b4247e85670?format=markdown)
