beautysh icon indicating copy to clipboard operation
beautysh copied to clipboard

mangles indentation after multiline strings with trailing whitespace

Open diachedelic opened this issue 3 years ago • 1 comments

So strange! Works if I remove the space at the end of the string.

$ scripts/beautysh.py - <<EOF
> #!/bin/bash
> VAR="
> text "
> 
> if true; then
> echo should be indented
> fi
> EOF
#!/bin/bash
VAR="
text "

if true; then
echo should be indented
fi

diachedelic avatar Aug 19 '20 02:08 diachedelic

Also occurs with variables ending with a newline.

$ scripts/beautysh.py - <<EOF
> #!/bin/bash
> VAR="
> "
> 
> if true; then
> echo should be indented
> fi
> EOF
#!/bin/bash
VAR="
"

if true; then
echo should be indented
fi

diachedelic avatar Aug 19 '20 02:08 diachedelic