Skip to content

Commit

Permalink
fix: commands not found in zvm_config (#206)
Browse files Browse the repository at this point in the history
When using zvm native commands in `zvm_config`, such as `zvm_cursor_style`,
you will not be able to invoke them, as they haven't be defined at the
moment `zvm_config` is invoked.
  • Loading branch information
jeffreytse committed Mar 17, 2023
1 parent 0e66668 commit 2f68ea9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions zsh-vi-mode.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,6 @@ ZVM_REPEAT_COMMANDS=($ZVM_MODE_NORMAL i)
# Default config function
: ${ZVM_CONFIG_FUNC:='zvm_config'}

# Load config by calling the config function
if command -v "$ZVM_CONFIG_FUNC" >/dev/null; then
$ZVM_CONFIG_FUNC
fi

# Set the readkey engine (default is NEX engine)
: ${ZVM_READKEY_ENGINE:=$ZVM_READKEY_ENGINE_DEFAULT}

Expand Down Expand Up @@ -3451,6 +3446,11 @@ function zvm_exec_commands() {
done
}

# Load config by calling the config function
if zvm_exist_command "$ZVM_CONFIG_FUNC"; then
$ZVM_CONFIG_FUNC
fi

# Initialize this plugin according to the mode
case $ZVM_INIT_MODE in
sourcing) zvm_init;;
Expand Down

0 comments on commit 2f68ea9

Please sign in to comment.