mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-17 19:30:10 +00: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:
parent
74a3db75e4
commit
1e26ad1187
1 changed files with 4 additions and 9 deletions
|
@ -103,15 +103,10 @@ get_space () {
|
||||||
local STR=$1$2
|
local STR=$1$2
|
||||||
local zero='%([BSUbfksu]|([FB]|){*})'
|
local zero='%([BSUbfksu]|([FB]|){*})'
|
||||||
local LENGTH=${#${(S%%)STR//$~zero/}}
|
local LENGTH=${#${(S%%)STR//$~zero/}}
|
||||||
local SPACES=""
|
local SPACES=$(( COLUMNS - LENGTH - ${ZLE_RPROMPT_INDENT:-1} ))
|
||||||
(( LENGTH = ${COLUMNS} - $LENGTH - 1))
|
|
||||||
|
|
||||||
for i in {0..$LENGTH}
|
(( SPACES > 0 )) || return
|
||||||
do
|
printf ' %.0s' {1..$SPACES}
|
||||||
SPACES="$SPACES "
|
|
||||||
done
|
|
||||||
|
|
||||||
echo $SPACES
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_1LEFT="$_USERNAME $_PATH"
|
_1LEFT="$_USERNAME $_PATH"
|
||||||
|
|
Loading…
Reference in a new issue