mvdan / sh

A shell parser, formatter, and interpreter with bash support; includes shfmt
https://pkg.go.dev/mvdan.cc/sh/v3
BSD 3-Clause "New" or "Revised" License
7.1k stars 336 forks source link

syntax: fix whitespace on nested subshells #874

Closed riacataquian closed 2 years ago

riacataquian commented 2 years ago

we want white space on nested subshells if its in a single line since its ambiguous, eg we want ( ( over ((

this shouldn't be the case for multiple lines- fix the logic that adds white space to only do so if the two subshells are in the same line

fixes https://github.com/mvdan/sh/issues/814