Commit 88fac5c
authored
syntax: don't join then/do with semicolon when heredocs are pending (#1320)
When a heredoc redirect appears in an if/while condition, semiOrNewl
would place "; then" or "; do" on the same line as the redirect,
producing hard-to-read output like:
if cmd <<EOF; then
body
EOF
foo
fi
Now force a newline when there are pending heredocs, so the heredoc
body is flushed before the keyword:
if cmd <<EOF
body
EOF
then
foo
fi
Fixes #1047.1 parent b2c5d6c commit 88fac5c
2 files changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
| 362 | + | |
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
| |||
0 commit comments