aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2025-02-17 18:42:19 -0800
committerKaz Kylheku <kaz@kylheku.com>2025-02-17 18:42:19 -0800
commit7c2e2963150c6efb22619cec5cd7202eb14f1eb4 (patch)
treee2cd23ac889c837528adbb4433b572509fdbaa0b
parente2152c591b0b8b3f5d8571cb04ea6576ea62ba43 (diff)
downloadbasta-7c2e2963150c6efb22619cec5cd7202eb14f1eb4.tar.gz
basta-7c2e2963150c6efb22619cec5cd7202eb14f1eb4.tar.bz2
basta-7c2e2963150c6efb22619cec5cd7202eb14f1eb4.zip
Get rid of deep flag in update.
* basta.sh (basta.update_status): Eliminate the deep flag. Always repaint all the status lines together. Without this, if the user runs the reset command, the lower status lines disappear. I.e. it worked better with the bug whereby we were always setting deep=y.
-rw-r--r--basta.sh31
1 files changed, 12 insertions, 19 deletions
diff --git a/basta.sh b/basta.sh
index af96e02..fdf994e 100644
--- a/basta.sh
+++ b/basta.sh
@@ -101,19 +101,14 @@ basta.update_status()
local tio_lines
local tio_cols
local i j
- local deep=
basta.query_termios_lines_cols tio_lines tio_cols
- if ! [ "$1" != WINCH -a \
- $LINES -eq $basta_old_lines -a \
- $COLUMNS -eq $basta_old_cols -a \
- $LINES -eq $tio_lines -a \
- $COLUMNS -eq $tio_cols ]
- then
- basta.prepare_term
- deep=y
- fi
+ [ "$1" != WINCH -a \
+ $LINES -eq $basta_old_lines -a \
+ $COLUMNS -eq $basta_old_cols -a \
+ $LINES -eq $tio_lines -a \
+ $COLUMNS -eq $tio_cols ] || basta.prepare_term
local status_esc=$'\e[7m\e[m'
local status_date=$(date +%m-%d/%H:%M)
@@ -135,16 +130,14 @@ basta.update_status()
printf $'\e7\e[%s;1H\e[K%s\e[1;%sr' \
$((basta_scroll_lines + 1)) "$status" $basta_scroll_lines
- if [ $deep ] ; then
- printf $'\e[=7l'
- for (( i = $basta_prev_reserved_rows - 1, j = 2; i >= 0; i--, j++ )) ; do
- printf $'\e[%s;1H\e[K%s' \
- $((basta_scroll_lines + j)) "${LC_basta_status[i]}"
- done
- printf $'\e[=7h'
- fi
+ printf $'\e[=7l'
+ for (( i = $basta_prev_reserved_rows - 1, j = 2; i >= 0; i--, j++ )) ; do
+ printf $'\e[%s;1H\e[K%s' \
+ $((basta_scroll_lines + j)) "${LC_basta_status[i]}"
+ done
+ printf $'\e[=7h'
- printf '\e8'
+ printf $'\e8'
LC_basta_status[$basta_prev_reserved_rows]=$status
basta.export_array LC_basta_status