diff options
author | Marc Cornellà <hello@mcornella.com> | 2022-02-07 17:52:57 +0100 |
---|---|---|
committer | Marc Cornellà <hello@mcornella.com> | 2022-02-07 17:57:59 +0100 |
commit | 1e26ad1187cdee286d0332dbdffb6828a71140c2 (patch) | |
tree | b6de04b247ffbfdaae6d579727a5842ecdf9c930 /themes | |
parent | 74a3db75e46067ebc627a22b12aac523a9606b92 (diff) | |
download | zsh-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-theme | 13 |
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` |