1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-22 13:28:00 +08:00

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.
This commit is contained in:
Marc Cornellà 2022-02-07 17:52:57 +01:00
parent 74a3db75e4
commit 1e26ad1187
No known key found for this signature in database
GPG Key ID: 0314585E776A9C1B

View File

@ -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`