Skip to content

Commit

Permalink
Removed some echo calls
Browse files Browse the repository at this point in the history
  • Loading branch information
blmayer committed Dec 4, 2023
1 parent 844c74f commit 30574fd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions astro
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ typesetgmi() {
stop
while IFS='' read -r line || [ -n "$line" ];
do
line="$(echo "$line" | tr -d '\r')"
echo "$line" | grep -q "^\`\`\`" && pre=$((1 - pre)) && line=""
line="$(printf "$line\n" | tr -d '\r')"
printf "$line\n" | grep -q "^\`\`\`" && pre=$((1 - pre)) && line=""

# add margins and fold
if [ "$pre" = 1 ]
Expand Down Expand Up @@ -268,15 +268,13 @@ typesetgmi() {
'* '*) sty="$sty_listb$sty_listt" && line="${line#* }";;
*) sty='' ;;
esac
echo "$line" | fold -w "$width" -s | {
printf -- "$line\n" | fold -w "$width" -s | {
while IFS='' read -r txt
do
printf "%*s" "$margin" ""

# shellcheck disable=SC2059
printf -- "$sty"
echo "$txt"
printf '\e[m'
printf -- "$sty$txt\n\e[m"
done
}
done
Expand Down

0 comments on commit 30574fd

Please sign in to comment.