cleanup: Leave max size config unset by default to match other options

pull/418/head
Eric Freese 6 years ago
parent d8ba53678e
commit db290c518b

@ -63,7 +63,7 @@ Widgets that modify the buffer and are not found in any of these arrays will fet
### Disabling suggestion for large buffers
Set `ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE` to an integer value to disable autosuggestion for large buffers. The default is unset, which means that autosuggestion will be tried for any buffer size. Recommended value is 20.
This can be useful when pasting large amount of text in the terminal, to avoid triggering autosuggestion for too long strings.
This can be useful when pasting large amount of text in the terminal, to avoid triggering autosuggestion for strings that are too long.
### Enable Asynchronous Mode

@ -85,7 +85,3 @@ typeset -g ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX=autosuggest-orig-
yank-pop
)
}
# Max size of buffer to trigger autosuggestion. Leave null for no upper bound.
(( ! ${+ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE} )) &&
typeset -g ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=

@ -85,7 +85,7 @@ _zsh_autosuggest_modify() {
# Get a new suggestion if the buffer is not empty after modification
if (( $#BUFFER > 0 )); then
if [[ -z "$ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE" ]] || (( $#BUFFER <= $ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE )); then
if (( ! ${+ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE} )) || (( $#BUFFER <= $ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE )); then
_zsh_autosuggest_fetch
fi
fi

@ -122,10 +122,6 @@ typeset -g ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX=autosuggest-orig-
)
}
# Max size of buffer to trigger autosuggestion. Leave null for no upper bound.
(( ! ${+ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE} )) &&
typeset -g ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=
#--------------------------------------------------------------------#
# Utility Functions #
#--------------------------------------------------------------------#
@ -356,7 +352,7 @@ _zsh_autosuggest_modify() {
# Get a new suggestion if the buffer is not empty after modification
if (( $#BUFFER > 0 )); then
if [[ -z "$ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE" ]] || (( $#BUFFER <= $ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE )); then
if (( ! ${+ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE} )) || (( $#BUFFER <= $ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE )); then
_zsh_autosuggest_fetch
fi
fi

Loading…
Cancel
Save