From 9279eff0ad1816564c6497cd38fc6308a4e1f42d Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Wed, 7 Feb 2018 17:44:47 +0800 Subject: [PATCH] more zsh style code --- src/strategies/predefined.zsh | 4 ++-- zsh-autosuggestions.zsh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/strategies/predefined.zsh b/src/strategies/predefined.zsh index 534781c..1d4839a 100644 --- a/src/strategies/predefined.zsh +++ b/src/strategies/predefined.zsh @@ -74,8 +74,8 @@ _zsh_autosuggest_strategy_predefined() { pname="${ZSH_AUTOSUGGEST_PREDEFINE_NAME:-$pname}" local names="${ZSH_AUTOSUGGEST_PREDEFINE_PATH};$pname" local array=() - for i ("${(@s/;/)names}"); do - if [ -n "$i" ] && [ -f "$i" ]; then + for i ("${(s:;:)names}"); do + if [[ -n "$i" ]] && [[ -f "$i" ]]; then local temp=(${(f)"$(<$i)"}) array+=($temp) fi diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index b28d6dd..e4b1c01 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -640,8 +640,8 @@ _zsh_autosuggest_strategy_predefined() { pname="${ZSH_AUTOSUGGEST_PREDEFINE_NAME:-$pname}" local names="${ZSH_AUTOSUGGEST_PREDEFINE_PATH};$pname" local array=() - for i ("${(@s/;/)names}"); do - if [ -n "$i" ] && [ -f "$i" ]; then + for i ("${(s:;:)names}"); do + if [[ -n "$i" ]] && [[ -f "$i" ]]; then local temp=(${(f)"$(<$i)"}) array+=($temp) fi