From 1e26ad1187cdee286d0332dbdffb6828a71140c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 7 Feb 2022 17:52:57 +0100 Subject: [PATCH] fix(bureau): fix top line space computation Takes into account $ZLE_RPROMPT_INDENT and doesn't add the extra space at the end so it doesn't bleed into the next line. --- themes/bureau.zsh-theme | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/themes/bureau.zsh-theme b/themes/bureau.zsh-theme index a5a8a2b20..698aa2ff8 100644 --- a/themes/bureau.zsh-theme +++ b/themes/bureau.zsh-theme @@ -103,19 +103,14 @@ get_space () { local STR=$1$2 local zero='%([BSUbfksu]|([FB]|){*})' local LENGTH=${#${(S%%)STR//$~zero/}} - local SPACES="" - (( LENGTH = ${COLUMNS} - $LENGTH - 1)) + local SPACES=$(( COLUMNS - LENGTH - ${ZLE_RPROMPT_INDENT:-1} )) - for i in {0..$LENGTH} - do - SPACES="$SPACES " - done - - echo $SPACES + (( SPACES > 0 )) || return + printf ' %.0s' {1..$SPACES} } _1LEFT="$_USERNAME $_PATH" -_1RIGHT="[%*] " +_1RIGHT="[%*]" bureau_precmd () { _1SPACES=`get_space $_1LEFT $_1RIGHT`