__/level
This commit is contained in:
parent
3a35802eb8
commit
5e86e7368b
1 changed files with 6 additions and 7 deletions
|
@ -202,12 +202,10 @@ _SPCD_RULE_RIGHT="╴"
|
||||||
# │ internals │ step │
|
# │ internals │ step │
|
||||||
# ╰───────────┴──────╯
|
# ╰───────────┴──────╯
|
||||||
|
|
||||||
_SPCD_STEP_LEVEL=1
|
|
||||||
|
|
||||||
_spcd_step_wipe() {
|
_spcd_step_wipe() {
|
||||||
unset \
|
unset \
|
||||||
"__SPCD_STEP_${_SPCD_STEP_LEVEL}_INDEX" \
|
"__SPCD_STEP_${__SPCD_STEP_LEVEL}_INDEX" \
|
||||||
"__SPCD_STEP_${_SPCD_STEP_LEVEL}_LABEL"
|
"__SPCD_STEP_${__SPCD_STEP_LEVEL}_LABEL"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭───────────╮
|
# ╭───────────╮
|
||||||
|
@ -376,7 +374,8 @@ spcd_split() {
|
||||||
|
|
||||||
spcd_step() {
|
spcd_step() {
|
||||||
if [ -n "${1}" ]; then
|
if [ -n "${1}" ]; then
|
||||||
spcd_step__prefix="__SPCD_STEP_${_SPCD_STEP_LEVEL}"
|
[ -n "${__SPCD_STEP_LEVEL}" ] || __SPCD_STEP_LEVEL=1
|
||||||
|
spcd_step__prefix="__SPCD_STEP_${__SPCD_STEP_LEVEL}"
|
||||||
spcd_step__index="${spcd_step__prefix}_INDEX"
|
spcd_step__index="${spcd_step__prefix}_INDEX"
|
||||||
eval "${spcd_step__index}=\$((${spcd_step__index} + 1))"
|
eval "${spcd_step__index}=\$((${spcd_step__index} + 1))"
|
||||||
eval "${spcd_step__prefix}_LABEL=\"${1}\""
|
eval "${spcd_step__prefix}_LABEL=\"${1}\""
|
||||||
|
@ -386,13 +385,13 @@ spcd_step() {
|
||||||
|
|
||||||
spcd_step_in() {
|
spcd_step_in() {
|
||||||
[ -n "${1}" ] && spcd_step "${1}"
|
[ -n "${1}" ] && spcd_step "${1}"
|
||||||
_SPCD_STEP_LEVEL=$((_SPCD_STEP_LEVEL + 1))
|
__SPCD_STEP_LEVEL=$((__SPCD_STEP_LEVEL + 1))
|
||||||
_spcd_step_wipe
|
_spcd_step_wipe
|
||||||
}
|
}
|
||||||
|
|
||||||
spcd_step_out() {
|
spcd_step_out() {
|
||||||
_spcd_step_wipe
|
_spcd_step_wipe
|
||||||
_SPCD_STEP_LEVEL=$((_SPCD_STEP_LEVEL - 1))
|
__SPCD_STEP_LEVEL=$((__SPCD_STEP_LEVEL - 1))
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭───────╮
|
# ╭───────╮
|
||||||
|
|
Loading…
Reference in a new issue