Procházet zdrojové kódy

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").
pull/433/head
Eric Freese před 5 roky
rodič
revize
474c577f3c
2 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. +1
    -1
      src/widgets.zsh
  2. +1
    -1
      zsh-autosuggestions.zsh

+ 1
- 1
src/widgets.zsh Zobrazit soubor

@ -85,7 +85,7 @@ _zsh_autosuggest_modify() {
# Get a new suggestion if the buffer is not empty after modification
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
fi
fi

+ 1
- 1
zsh-autosuggestions.zsh Zobrazit soubor

@ -346,7 +346,7 @@ _zsh_autosuggest_modify() {
# Get a new suggestion if the buffer is not empty after modification
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
fi
fi

Načítá se…
Zrušit
Uložit