From d8ba53678e27ca52e9d701cc74c6045751a8f838 Mon Sep 17 00:00:00 2001 From: Eric Freese Date: Wed, 10 Apr 2019 11:20:08 -0600 Subject: [PATCH] cleanup: Use `+` param expansion flag in arithmetic context --- src/widgets.zsh | 2 +- zsh-autosuggestions.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets.zsh b/src/widgets.zsh index 1d125d0..450ed3c 100644 --- a/src/widgets.zsh +++ b/src/widgets.zsh @@ -95,7 +95,7 @@ _zsh_autosuggest_modify() { # Fetch a new suggestion based on what's currently in the buffer _zsh_autosuggest_fetch() { - if [[ -n "${ZSH_AUTOSUGGEST_USE_ASYNC+x}" ]]; then + if (( ${+ZSH_AUTOSUGGEST_USE_ASYNC} )); then _zsh_autosuggest_async_request "$BUFFER" else local suggestion diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index e7e14a1..bae4ba8 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -366,7 +366,7 @@ _zsh_autosuggest_modify() { # Fetch a new suggestion based on what's currently in the buffer _zsh_autosuggest_fetch() { - if [[ -n "${ZSH_AUTOSUGGEST_USE_ASYNC+x}" ]]; then + if (( ${+ZSH_AUTOSUGGEST_USE_ASYNC} )); then _zsh_autosuggest_async_request "$BUFFER" else local suggestion