diff --git a/functions b/functions index 2f9faec..f9300e4 100644 --- a/functions +++ b/functions @@ -169,7 +169,7 @@ update_terminal_width() { # Add trap for terminal resize trap 'update_terminal_width' WINCH - set_borders() { +set_borders() { top_border=$1 bottom_border=$2 left_border=$3 @@ -270,7 +270,8 @@ box-light(){ esac } -#set-boxtype +update_terminal_width +set-boxtype repchar() { # More robust parameter checking @@ -296,6 +297,14 @@ repchar() { printf -v result "%*s" "$count" "" echo "${result// /$char}" } +test_boxtop() { + echo "Debug - BOXWIDTH: $BOXWIDTH" >&2 + echo "Debug - top_border: '$top_border'" >&2 + echo "Debug - left_top_border: '$left_top_border'" >&2 + local rep_result=$(repchar "$top_border" "$((BOXWIDTH-1))") + echo "Debug - repchar result: '$rep_result'" >&2 + printf "%s%s%s\n" "${brdr}$left_top_border" "$rep_result" "$right_top_border${dfl}" +} boxtop() { printf "%s%s%s\n" "${brdr}$left_top_border" "$(repchar "$top_border" "$((BOXWIDTH-1))")" "$right_top_border${dfl}" @@ -1465,5 +1474,6 @@ check-packages() { esac } - +set_box_chars +update_terminal_width set-boxtype