Skip to content

Commit

Permalink
use typeset
Browse files Browse the repository at this point in the history
  • Loading branch information
MenkeTechnologies committed May 19, 2022
1 parent ed90d41 commit 3d50ae3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/t-expand.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions zsh-expand.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 3d50ae3

Please sign in to comment.