diff --git a/src/strategies/completion.zsh b/src/strategies/completion.zsh index 8bbd7c8..422f4cc 100644 --- a/src/strategies/completion.zsh +++ b/src/strategies/completion.zsh @@ -117,6 +117,8 @@ _zsh_autosuggest_strategy_completion() { # Fetch the first completion result _zsh_autosuggest_capture_completion "$1" + [[ -z "$completion" ]] && return + # Add the completion string to the buffer to build the full suggestion local -i i=1 while [[ "$completion" != "${1[$i,-1]}"* ]]; do ((i++)); done diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index cad2847..4b617cc 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -616,6 +616,8 @@ _zsh_autosuggest_strategy_completion() { # Fetch the first completion result _zsh_autosuggest_capture_completion "$1" + [[ -z "$completion" ]] && return + # Add the completion string to the buffer to build the full suggestion local -i i=1 while [[ "$completion" != "${1[$i,-1]}"* ]]; do ((i++)); done