From 9572ccbea2e8290981bc91d5d63b2d555fbafc55 Mon Sep 17 00:00:00 2001 From: Lorenzo Bolla Date: Fri, 15 Jul 2016 09:39:33 +0100 Subject: [PATCH] Disable autosuggest if buffer is too large --- 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 ee1129f4..6c038579 100644 --- a/src/widgets.zsh +++ b/src/widgets.zsh @@ -24,7 +24,7 @@ _zsh_autosuggest_modify() { # Get a new suggestion if the buffer is not empty after modification local suggestion - if [ $#BUFFER -gt 0 ]; then + if [ $#BUFFER -gt 0 -a $#BUFFER -lt 20 ]; then suggestion="$(_zsh_autosuggest_suggestion "$BUFFER")" fi diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index 4e3c62e0..7a74ab00 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -242,7 +242,7 @@ _zsh_autosuggest_modify() { # Get a new suggestion if the buffer is not empty after modification local suggestion - if [ $#BUFFER -gt 0 ]; then + if [ $#BUFFER -gt 0 -a $#BUFFER -lt 20 ]; then suggestion="$(_zsh_autosuggest_suggestion "$BUFFER")" fi