Repeated use of unary minus on a long line can cause code to be reformatted into a comment. Short lines are handled correctly and formatted into -(-x).
To reproduce:
Create the following program:
_ = (- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5)
Observe that stylua -c suggests
1 |-_ = (- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5)
1 |+_ = ----------------------------------------5
which is incorrect.
Repeated use of unary minus on a long line can cause code to be reformatted into a comment. Short lines are handled correctly and formatted into
-(-x).To reproduce:
Create the following program:
Observe that
stylua -csuggests1 |-_ = (- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5) 1 |+_ = ----------------------------------------5which is incorrect.