mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-12-30 00:03:56 +08:00
Do not show suggestions if the buffer is empty
This commit is contained in:
parent
938144530c
commit
23ef16c297
|
@ -68,7 +68,7 @@ _zsh_autosuggest_fetch() {
|
||||||
_zsh_autosuggest_suggest() {
|
_zsh_autosuggest_suggest() {
|
||||||
local suggestion="$1"
|
local suggestion="$1"
|
||||||
|
|
||||||
if [ -n "$suggestion" ]; then
|
if [ -n "$suggestion" ] && [ $#BUFFER -gt 0 ]; then
|
||||||
POSTDISPLAY="${suggestion#$BUFFER}"
|
POSTDISPLAY="${suggestion#$BUFFER}"
|
||||||
else
|
else
|
||||||
unset POSTDISPLAY
|
unset POSTDISPLAY
|
||||||
|
|
|
@ -355,7 +355,7 @@ _zsh_autosuggest_fetch() {
|
||||||
_zsh_autosuggest_suggest() {
|
_zsh_autosuggest_suggest() {
|
||||||
local suggestion="$1"
|
local suggestion="$1"
|
||||||
|
|
||||||
if [ -n "$suggestion" ]; then
|
if [ -n "$suggestion" ] && [ $#BUFFER -gt 0 ]; then
|
||||||
POSTDISPLAY="${suggestion#$BUFFER}"
|
POSTDISPLAY="${suggestion#$BUFFER}"
|
||||||
else
|
else
|
||||||
unset POSTDISPLAY
|
unset POSTDISPLAY
|
||||||
|
|
Loading…
Reference in New Issue
Block a user