mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-12-16 10:11:25 +01:00
Allow setting max size to empty string (GitHub #422)
Some people have gotten used to setting ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE to an empty string rather than leaving it unset. This lets them continue to do that without getting any warnings (e.g. "bad math expression: operand expected at end of string").
This commit is contained in:
parent
e9d8231ba7
commit
474c577f3c
2 changed files with 2 additions and 2 deletions
|
@ -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 (( ! ${+ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE} )) || (( $#BUFFER <= $ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE )); then
|
if [[ -z "$ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE" ]] || (( $#BUFFER <= $ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE )); then
|
||||||
_zsh_autosuggest_fetch
|
_zsh_autosuggest_fetch
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -346,7 +346,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 (( ! ${+ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE} )) || (( $#BUFFER <= $ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE )); then
|
if [[ -z "$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 a new issue