diff --git a/src/bind.zsh b/src/bind.zsh index 757f640..cc020de 100644 --- a/src/bind.zsh +++ b/src/bind.zsh @@ -66,6 +66,9 @@ _zsh_autosuggest_bind_widgets() { # Given the name of an original widget and args, invoke it, if it exists _zsh_autosuggest_invoke_original_widget() { + # Do nothing unless called with at least one arg + [ $# -gt 0 ] || return + local original_widget_name=$1 shift diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index 40c58bc..5579101 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -168,6 +168,9 @@ _zsh_autosuggest_bind_widgets() { # Given the name of an original widget and args, invoke it, if it exists _zsh_autosuggest_invoke_original_widget() { + # Do nothing unless called with at least one arg + [ $# -gt 0 ] || return + local original_widget_name=$1 shift