From 3d50ae300f468d753454ad10f2f7888d2f6c8a9d Mon Sep 17 00:00:00 2001 From: MenkeTechnologies Date: Thu, 19 May 2022 04:46:17 -0400 Subject: [PATCH] use typeset --- tests/t-expand.zsh | 4 ++-- zsh-expand.plugin.zsh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/t-expand.zsh b/tests/t-expand.zsh index b3a5601..ca8c74a 100755 --- a/tests/t-expand.zsh +++ b/tests/t-expand.zsh @@ -9,7 +9,7 @@ #}}}*********************************************************** @setup { - declare -gA ZPWR_VARS + typeset -gA ZPWR_VARS 0="${${0:#$ZSH_ARGZERO}:-${(%):-%N}}" 0="${${(M)0:#/*}:-$PWD/$0}" pluginDir="${0:h:A}" @@ -51,7 +51,7 @@ } @test 'expand alias pwd="ls" keep space' { - declare -A ZPWR_VARS + typeset -A ZPWR_VARS LBUFFER=" ls" ZPWR_VARS[lastword_lbuffer]=ls ZPWR_VARS[EXPANDED]='ls' diff --git a/zsh-expand.plugin.zsh b/zsh-expand.plugin.zsh index 74657da..7f1516b 100644 --- a/zsh-expand.plugin.zsh +++ b/zsh-expand.plugin.zsh @@ -18,7 +18,7 @@ if ! (( $+ZPWR_VARS )) || [[ ${parameters[ZPWR_VARS]} != association ]]; then # global map to containerize global variables - declare -gA ZPWR_VARS + typeset -gA ZPWR_VARS fi ZPWR_VARS[ENTER_KEY]='ENTER' @@ -73,7 +73,7 @@ ZPWR_VARS[continueFirstPositionRegexNoZpwr]="^([[:space:]]*)${ZPWR_VARS[assignRe #ZPWR_VARS[continueFirstPositionRegex]="^([[:space:]]*)${ZPWR_VARS[assignRegex]}(([\\\"\']*builtin[\\\"\']*[[:space:]]+)*[\\\"\']*${ZPWR_VARS[builtinSkips]}[\\\"\']*)?([[:space:]]*)(([\\\"\']*zpwr[\\\"\']*([[:space:]]+)(-[[:graph:]]+)*)*([\\\"\']*sudo[\\\"\']*([[:space:]]+)((-[ABbEHnPSis]+[[:space:]]*|-[CghpTu][[:space:]=]+[[:graph:]]*[[:space:]]+|--)*)*)*${ZPWR_VARS[assignRegex]}([\\\"\']*env[\\\"\']*[[:space:]]+(-[iv]+[[:space:]]*|-[PSu][[:space:]=]+[[:graph:]]+[[:space:]]+|--)*)*${ZPWR_VARS[assignRegex]})*([[:space:]]*)([[:graph:]]+)$" #}}}*********************************************************** -declare -Ag ZPWR_EXPAND_CORRECT_WORDS +typeset -Ag ZPWR_EXPAND_CORRECT_WORDS ZPWR_EXPAND_CORRECT_WORDS[about]="aobut abbout aabout" ZPWR_EXPAND_CORRECT_WORDS[alternate]="alternaet alterntae" ZPWR_EXPAND_CORRECT_WORDS[also]="laso alos alsoo allso"