Vim builtin indentation seems to get confused with the following script. I cannot get Vim to indent properly the while-loop after the pipe.
#!/bin/bash
while true
do
# while loop is indented correctly
while read line
do
echo $line
done < myfile
# while loop after a pipe is NOT indented correctly despite gg=G
cat myfile | while read line
do
echo $line
done
done
Running gg=G
does not fix the indentation.
Any ideas?