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:
@@ -192,8 +192,8 @@ function cmd-on-enter {
|
|||||||
local idx=$cmd_on_enter_idx
|
local idx=$cmd_on_enter_idx
|
||||||
idx=$((idx < $#CMDS_ON_ENTER ? idx + 1 : 1))
|
idx=$((idx < $#CMDS_ON_ENTER ? idx + 1 : 1))
|
||||||
until
|
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
|
do
|
||||||
idx=$((idx < $#CMDS_ON_ENTER ? idx + 1 : 1))
|
idx=$((idx < $#CMDS_ON_ENTER ? idx + 1 : 1))
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user