Merge pull request #502 from zsh-users/cleanup/idiomatic-check-if-set

cleanup: Use more idiomatic method of checking if var is set
This commit is contained in:
Eric Freese 2020-01-27 21:46:14 -07:00 committed by GitHub
commit a32fe24acc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

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

View File

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