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