From 49d312b60eea78d88a24ac39b8b2b5d764705722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Poulsen?= Date: Sat, 19 Feb 2011 12:26:39 +0200 Subject: [PATCH 2/2] Update DEL_TEXT when recalculating columns. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit STAT_COL is used to define DEL_TEXT, so DEL_TEXT have to be updated whenever STAT_COL is. Signed-off-by: Søren Poulsen --- functions | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/functions b/functions index 4870883..b6ea070 100644 --- a/functions +++ b/functions @@ -25,6 +25,16 @@ calc_columns() { # we use 13 characters for our own stuff STAT_COL=$(($STAT_COL - 13)) + + if [[ -t 1 ]]; then + SAVE_POSITION="\033[s" + RESTORE_POSITION="\033[u" + DEL_TEXT="\033[$(($STAT_COL+4))G" + else + SAVE_POSITION="" + RESTORE_POSITION="" + DEL_TEXT="" + fi } calc_columns @@ -71,16 +81,6 @@ if [[ $USECOLOR = YES || $USECOLOR = yes ]]; then C_CLEAR="\033[1;0m" fi -if [[ -t 1 ]]; then - SAVE_POSITION="\033[s" - RESTORE_POSITION="\033[u" - DEL_TEXT="\033[$(($STAT_COL+4))G" -else - SAVE_POSITION="" - RESTORE_POSITION="" - DEL_TEXT="" -fi - # prefixes: PREFIX_REG="::" -- 1.7.4.1