Fix demo rotation and move demo to top
This commit is contained in:
@@ -228,14 +228,13 @@ _ps1_demo_next() {
|
||||
"" "" "" "" "" "" ""
|
||||
)
|
||||
local count=${#styles[@]}
|
||||
if [[ -z "${__PS1_DEMO_INDEX+x}" ]]; then
|
||||
__PS1_DEMO_INDEX=0
|
||||
else
|
||||
__PS1_DEMO_INDEX=$(( (__PS1_DEMO_INDEX + 1) % count ))
|
||||
fi
|
||||
__PS1_DEMO_STYLE="${styles[$__PS1_DEMO_INDEX]}"
|
||||
__PS1_DEMO_PACK="${packs[$__PS1_DEMO_INDEX]}"
|
||||
__PS1_DEMO_HOLIDAY="${holidays[$__PS1_DEMO_INDEX]}"
|
||||
local idx="${PS1_DEMO_INDEX:--1}"
|
||||
idx=$(( (idx + 1) % count ))
|
||||
PS1_DEMO_INDEX="$idx"
|
||||
export PS1_DEMO_INDEX
|
||||
__PS1_DEMO_STYLE="${styles[$idx]}"
|
||||
__PS1_DEMO_PACK="${packs[$idx]}"
|
||||
__PS1_DEMO_HOLIDAY="${holidays[$idx]}"
|
||||
}
|
||||
|
||||
# ---- Load Git prompt helper (best effort) ----
|
||||
|
||||
Reference in New Issue
Block a user