Pārlūkot izejas kodu

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

cleanup: Use more idiomatic method of checking if var is set
pull/506/merge
Eric Freese pirms 4 gadiem
revīziju iesūtīja GitHub
vecāks
revīzija
a32fe24acc
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
2 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. +2
    -2
      src/widgets.zsh
  2. +2
    -2
      zsh-autosuggestions.zsh

+ 2
- 2
src/widgets.zsh Parādīt failu

@ -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

+ 2
- 2
zsh-autosuggestions.zsh Parādīt failu

@ -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

Notiek ielāde…
Atcelt
Saglabāt