Prompt sigil update uses shift, instead of math
This commit is contained in:
+21
-16
@@ -62,45 +62,50 @@ _debug "Done with color cacheing loop"
|
||||
_debug "Dynamic color loading processed..."
|
||||
|
||||
|
||||
while( ${#reference_colors} == 0 )
|
||||
if( ${#reference_colors} == 0 ) then
|
||||
_debug colorshuffle
|
||||
#echo
|
||||
# Shuffle, if supported
|
||||
if( $?cshenv_detected_shuf ) then
|
||||
_debug "PRIMARY COLOR!"
|
||||
set reference_colors=`shuf -e $reference_colors_original`
|
||||
else
|
||||
#echo "FALLBACK COLOR!"
|
||||
_debug "FALLBACK COLOR!"
|
||||
set reference_colors=`echo $reference_colors_original | tr " " "\n" | sort -R | xargs`
|
||||
endif
|
||||
if( ! $?last_color ) then
|
||||
break
|
||||
endif
|
||||
if( $?last_color ) then
|
||||
set first_color = ${reference_colors[1]}
|
||||
if( ${first_color} == ${last_color} ) then
|
||||
set reference_colors=()
|
||||
continue
|
||||
_debug "COLLISION COLOR!"
|
||||
# Instead of a reshuffle, we put the collision at the end.
|
||||
set tmp_color="${reference_colors[1]}"
|
||||
shift reference_colors
|
||||
set reference_colors=( ${reference_colors} ${tmp_color} )
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
end
|
||||
|
||||
|
||||
while( ${#referencechars} == 0 )
|
||||
if( ${#referencechars} == 0 ) then
|
||||
_debug symbolshuffle
|
||||
#echo
|
||||
if( $?cshenv_detected_shuf ) then
|
||||
_debug "PRIMARY CHAR!"
|
||||
set referencechars=`shuf -e $referencechars_original`
|
||||
else
|
||||
#echo "FALLBACK CHAR!"
|
||||
_debug "FALLBACK CHAR!"
|
||||
set referencechars=(`echo $referencechars_original | tr " " "\n" | sort -R | xargs`)
|
||||
endif
|
||||
if( ! $?last_sym ) then
|
||||
break
|
||||
endif
|
||||
if( $?last_sym ) then
|
||||
set first_sym = ${referencechars[1]}
|
||||
if( ${first_sym} == ${last_sym} ) then
|
||||
set referencechars=()
|
||||
continue
|
||||
_debug "COLLISION CHAR!"
|
||||
set tmp_char="${referencechars[1]}"
|
||||
shift referencechars
|
||||
set referencechars=( ${referencechars} ${tmp_char} )
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
end
|
||||
|
||||
if( $?CSHENV_DEBUG ) then
|
||||
_debug ${reference_colors[1]} ${referencechars[1]}
|
||||
|
||||
Reference in New Issue
Block a user