From 7d968869e39df762a69b61510dc0b2207c3f9871 Mon Sep 17 00:00:00 2001 From: Eric Freese Date: Sat, 30 Jun 2018 15:03:14 -0600 Subject: [PATCH] Return if no completion found --- src/strategies/completion.zsh | 2 ++ zsh-autosuggestions.zsh | 2 ++ 2 files changed, 4 insertions(+) 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