Do not show suggestions if the buffer is empty

This commit is contained in:
Eric Freese 2017-02-17 18:26:34 -07:00
parent 938144530c
commit 23ef16c297
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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