From 23ef16c297fd17eec9688ff2c3d11bcdab416671 Mon Sep 17 00:00:00 2001 From: Eric Freese Date: Fri, 17 Feb 2017 18:26:34 -0700 Subject: [PATCH] Do not show suggestions if the buffer is empty --- src/widgets.zsh | 2 +- zsh-autosuggestions.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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