mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-12 08:10:07 +00:00
Fixed silly coding error
Did `local 3=...` instead of `3=...`
This commit is contained in:
parent
ec0f7bdacb
commit
2bd3e0f67e
1 changed files with 3 additions and 5 deletions
|
@ -226,7 +226,7 @@ function truncatePath() {
|
|||
# convert $2 from string to integer
|
||||
2=$(( $2 ))
|
||||
# set $3 to "" if not defined
|
||||
[[ -z $3 ]] && local 3="" || 3=$(echo -n $3)
|
||||
[[ -z $3 ]] && 3="" || 3=$(echo -n $3)
|
||||
# set $4 to "right" if not defined
|
||||
[[ -z $4 ]] && 4="right"
|
||||
# create a variable for the truncated path.
|
||||
|
@ -237,14 +237,12 @@ function truncatePath() {
|
|||
local paths=$1
|
||||
paths=(${(s:/:)${paths//"~\/"/}})
|
||||
# declare locals for the directory being tested and its length
|
||||
local test_dir test_dir_length delim_len
|
||||
local test_dir test_dir_length
|
||||
# do the needed truncation
|
||||
case $4 in
|
||||
right)
|
||||
# check the length of the delimiter
|
||||
[[ -z $3 ]] && delim_len=${#3} || delim_len=0
|
||||
# include the delimiter length in the threshhold
|
||||
local threshhold=$(( $2 + $delim_len ))
|
||||
local threshhold=$(( $2 + ${#3} ))
|
||||
# loop through the paths
|
||||
for (( i=1; i<${#paths}; i++ )); do
|
||||
# get the current directory value
|
||||
|
|
Loading…
Reference in a new issue