summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2022-02-07 17:52:57 +0100
committerMarc Cornellà <hello@mcornella.com>2022-02-07 17:57:59 +0100
commit1e26ad1187cdee286d0332dbdffb6828a71140c2 (patch)
treeb6de04b247ffbfdaae6d579727a5842ecdf9c930 /themes
parent74a3db75e46067ebc627a22b12aac523a9606b92 (diff)
downloadzsh-1e26ad1187cdee286d0332dbdffb6828a71140c2.tar.gz
zsh-1e26ad1187cdee286d0332dbdffb6828a71140c2.tar.bz2
zsh-1e26ad1187cdee286d0332dbdffb6828a71140c2.zip
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.
Diffstat (limited to 'themes')
-rw-r--r--themes/bureau.zsh-theme13
1 files 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`