From f06305c948a1e89cc0c4c63a51baf6cdc3a23f95 Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Thu, 8 Feb 2018 02:53:35 +0800 Subject: [PATCH] more zsh style code --- src/strategies/predefined.zsh | 2 +- zsh-autosuggestions.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/strategies/predefined.zsh b/src/strategies/predefined.zsh index 1d4839a..5993ff2 100644 --- a/src/strategies/predefined.zsh +++ b/src/strategies/predefined.zsh @@ -67,7 +67,7 @@ _zsh_autosuggest_strategy_predefined() { local prefix="${1//(#m)[\\*?[\]<>()|^~#]/\\$MATCH}" local result="${history[(r)${prefix}*]}" - if [[ $result == "" ]]; then + if [[ -z "$result" ]]; then if (( ! ${+_ZSH_AUTOSUGGEST_PREDEFINE} )); then typeset -g _ZSH_AUTOSUGGEST_PREDEFINE=() local pname="$HOME/.zsh_autosuggest" diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index e4b1c01..e836e43 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -633,7 +633,7 @@ _zsh_autosuggest_strategy_predefined() { local prefix="${1//(#m)[\\*?[\]<>()|^~#]/\\$MATCH}" local result="${history[(r)${prefix}*]}" - if [[ $result == "" ]]; then + if [[ -z "$result" ]]; then if (( ! ${+_ZSH_AUTOSUGGEST_PREDEFINE} )); then typeset -g _ZSH_AUTOSUGGEST_PREDEFINE=() local pname="$HOME/.zsh_autosuggest"