diff --git a/src/widgets.zsh b/src/widgets.zsh index 3031066..a0a59d5 100644 --- a/src/widgets.zsh +++ b/src/widgets.zsh @@ -68,7 +68,7 @@ _zsh_autosuggest_fetch() { _zsh_autosuggest_suggest() { local suggestion="$1" - if [ -n "$suggestion" ]; then + if [ -n "$suggestion" ] && [ $#BUFFER -gt 0 ]; then POSTDISPLAY="${suggestion#$BUFFER}" else unset POSTDISPLAY diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index f33c3d2..ed631c3 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -355,7 +355,7 @@ _zsh_autosuggest_fetch() { _zsh_autosuggest_suggest() { local suggestion="$1" - if [ -n "$suggestion" ]; then + if [ -n "$suggestion" ] && [ $#BUFFER -gt 0 ]; then POSTDISPLAY="${suggestion#$BUFFER}" else unset POSTDISPLAY