mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-12-28 15:14:51 +08:00
cleanup: Leave max size config unset by default to match other options
This commit is contained in:
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
|
### 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.
|
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
|
### Enable Asynchronous Mode
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,3 @@ typeset -g ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX=autosuggest-orig-
|
||||||
yank-pop
|
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
|
# Get a new suggestion if the buffer is not empty after modification
|
||||||
if (( $#BUFFER > 0 )); then
|
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
|
_zsh_autosuggest_fetch
|
||||||
fi
|
fi
|
||||||
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 #
|
# Utility Functions #
|
||||||
#--------------------------------------------------------------------#
|
#--------------------------------------------------------------------#
|
||||||
|
@ -356,7 +352,7 @@ _zsh_autosuggest_modify() {
|
||||||
|
|
||||||
# Get a new suggestion if the buffer is not empty after modification
|
# Get a new suggestion if the buffer is not empty after modification
|
||||||
if (( $#BUFFER > 0 )); then
|
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
|
_zsh_autosuggest_fetch
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user