You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmm, this is trickier than I thought because we don't record any position information for escaped newlines, so we can't at the moment preserve the padding/alignment.
I'm not going to work on this. -kp works on tokens, and escaped newlines are not tokens. They are skipped by the parser (just like in all shells), and they are only encoded in the syntax tree by how the previous and following tokens are on different lines.
So we don't have the information necessary to know in what column an escaped newline was. Adding that would complicate the parser and syntax tree, and I just don't think it's worth the effort. Closing for now.
I expected this code snippet not to be reformatted when using
shfmt -kp -ci 2 -d
:Specifically, I'd expect
\
not to be moved when-kp
is used. Issue #344 is related, though not the same.The text was updated successfully, but these errors were encountered: