zsh:keys:cmd-on-enter: Switch until conditions

The requirement does not need to be executed if the idx wrapped around
already.
This commit is contained in:
2025-03-26 00:51:19 +01:00
parent a9bd4585aa
commit 0cb18dedef

View File

@@ -192,8 +192,8 @@ function cmd-on-enter {
local idx=$cmd_on_enter_idx
idx=$((idx < $#CMDS_ON_ENTER ? idx + 1 : 1))
until
$REQUIREMENTS_CMDS_ON_ENTER[$idx] &>/dev/null \
|| [[ $idx = $cmd_on_enter_idx ]]
[[ $idx = $cmd_on_enter_idx ]] \
|| $REQUIREMENTS_CMDS_ON_ENTER[$idx] &>/dev/null
do
idx=$((idx < $#CMDS_ON_ENTER ? idx + 1 : 1))
done