EditorConfig: Switch from tabs to spaces

This commit is contained in:
Tobias Bergkvist 2021-10-04 22:38:14 +02:00
parent b7d36b8d59
commit 4b833cc141

View file

@ -12,23 +12,23 @@
# Count the number of lines before the output text starts
# commandLineCount FILE
commandLineCount() {
local n state
n=0
state="init"
while IFS="" read -r p || [ -n "$p" ]; do
case $state in
init)
if [[ $p =~ ^//.*\\$ ]]; then state="comment"
elif [[ $p =~ ^//.* ]]; then state="padding"
else break
fi
;;
comment) [[ ! $p =~ ^.*\\$ ]] && state="padding";;
padding) [ -n "${p// }" ] && break;;
esac
n=$((n+1))
done < "$1"
printf '%s' "$n"
local n state
n=0
state="init"
while IFS="" read -r p || [ -n "$p" ]; do
case $state in
init)
if [[ $p =~ ^//.*\\$ ]]; then state="comment"
elif [[ $p =~ ^//.* ]]; then state="padding"
else break
fi
;;
comment) [[ ! $p =~ ^.*\\$ ]] && state="padding";;
padding) [ -n "${p// }" ] && break;;
esac
n=$((n+1))
done < "$1"
printf '%s' "$n"
}
# getInputCommand FILE