cleanup: Use more idiomatic method of checking if var is set

We are already using this method in other places.

For example: `ZSH_AUTOSUGGEST_USE_ASYNC`
This commit is contained in:
Eric Freese 2020-01-25 07:44:44 -07:00
parent ae315ded4d
commit f90d040784
2 changed files with 4 additions and 4 deletions

View file

@ -20,7 +20,7 @@ _zsh_autosuggest_enable() {
# Toggle suggestions (enable/disable) # Toggle suggestions (enable/disable)
_zsh_autosuggest_toggle() { _zsh_autosuggest_toggle() {
if [[ -n "${_ZSH_AUTOSUGGEST_DISABLED+x}" ]]; then if (( ${+_ZSH_AUTOSUGGEST_DISABLED} )); then
_zsh_autosuggest_enable _zsh_autosuggest_enable
else else
_zsh_autosuggest_disable _zsh_autosuggest_disable
@ -79,7 +79,7 @@ _zsh_autosuggest_modify() {
fi fi
# Bail out if suggestions are disabled # Bail out if suggestions are disabled
if [[ -n "${_ZSH_AUTOSUGGEST_DISABLED+x}" ]]; then if (( ${+_ZSH_AUTOSUGGEST_DISABLED} )); then
return $? return $?
fi fi

View file

@ -282,7 +282,7 @@ _zsh_autosuggest_enable() {
# Toggle suggestions (enable/disable) # Toggle suggestions (enable/disable)
_zsh_autosuggest_toggle() { _zsh_autosuggest_toggle() {
if [[ -n "${_ZSH_AUTOSUGGEST_DISABLED+x}" ]]; then if (( ${+_ZSH_AUTOSUGGEST_DISABLED} )); then
_zsh_autosuggest_enable _zsh_autosuggest_enable
else else
_zsh_autosuggest_disable _zsh_autosuggest_disable
@ -341,7 +341,7 @@ _zsh_autosuggest_modify() {
fi fi
# Bail out if suggestions are disabled # Bail out if suggestions are disabled
if [[ -n "${_ZSH_AUTOSUGGEST_DISABLED+x}" ]]; then if (( ${+_ZSH_AUTOSUGGEST_DISABLED} )); then
return $? return $?
fi fi