diff options
-rwxr-xr-x | bollux | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bollux b/bollux index 8e1207b..919c370 100755 --- a/bollux +++ b/bollux | |||
@@ -689,7 +689,7 @@ typeset_gemini() { | |||
689 | ( | 689 | ( |
690 | : | 690 | : |
691 | : | 691 | : |
692 | ) # XXX this doesn't work!? | 692 | ) # dumb formatting brought to you by shfmt |
693 | log d "LINES=$LINES; COLUMNS=$COLUMNS" | 693 | log d "LINES=$LINES; COLUMNS=$COLUMNS" |
694 | T_WIDTH=$COLUMNS | 694 | T_WIDTH=$COLUMNS |
695 | fi | 695 | fi |
@@ -825,7 +825,9 @@ fold_line() { # fold_line WIDTH TEXT | |||
825 | set -- $2 # TODO: is this the best way? | 825 | set -- $2 # TODO: is this the best way? |
826 | 826 | ||
827 | for word; do | 827 | for word; do |
828 | shopt -s extglob | ||
828 | plain="${word//$'\x1b'\[*([0-9;])m/}" | 829 | plain="${word//$'\x1b'\[*([0-9;])m/}" |
830 | shopt -u extglob | ||
829 | wl=$((${#plain} + 1)) | 831 | wl=$((${#plain} + 1)) |
830 | if (((ll + wl) >= width)); then | 832 | if (((ll + wl) >= width)); then |
831 | printf "\n%${margin}s" ' ' | 833 | printf "\n%${margin}s" ' ' |