diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-12-19 16:09:47 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-12-19 16:09:47 -0800 |
commit | 7fbdc5a088c37bd24da5954474a189cd4c890dce (patch) | |
tree | 871381d6715e5e179f195d8a02f5a7e2d99a3e02 | |
parent | 83638902f7d4ecfefe959732409e7db40d429e00 (diff) | |
download | basta-7fbdc5a088c37bd24da5954474a189cd4c890dce.tar.gz basta-7fbdc5a088c37bd24da5954474a189cd4c890dce.tar.bz2 basta-7fbdc5a088c37bd24da5954474a189cd4c890dce.zip |
Streamline code in basta.prepare_term.
- We calculate the final LINES value unconditionally whether
or not it is the first call that sets basta_prev_reserved_rows.
Then we just copy that value into basta_scroll_lines and
basta_old_lines. We don't rely on the side effect of the
"stty rows" command setting LINES.
-rw-r--r-- | basta.sh | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -29,14 +29,14 @@ basta.prepare_term() if [ -z "$basta_prev_reserved_rows" ] ; then basta_prev_reserved_rows=$((realrows - LINES)) printf "\n\033[A" - else - LINES=$((realrows - $basta_prev_reserved_rows)) fi - basta_scroll_lines=$((LINES - 1)) - stty rows $basta_scroll_lines + LINES=$((realrows - $basta_prev_reserved_rows - 1)) + + basta_scroll_lines=$LINES basta_old_lines=$LINES basta_old_cols=$COLUMNS + stty rows $LINES } basta.get_cur_line() |