From acc129de6c3f425180e440135fe07003c7a2bd6f Mon Sep 17 00:00:00 2001 From: Eric Freese Date: Wed, 17 Feb 2016 13:41:37 -0700 Subject: [PATCH] Fix error when using autosuggest widgets --- src/bind.zsh | 3 +++ zsh-autosuggestions.zsh | 3 +++ 2 files changed, 6 insertions(+) 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