mirror of
https://gitee.com/mirrors/ohmyzsh.git
synced 2026-10-16 06:36:45 +08:00
style: declare globals properly
By default, `typeset` defines variables locally unless in the main scope. This is specially bad when using `omz plugin load`, which happens inside a function, so the declared variables don't continue being defined when the function finishes and the main scope reappears.
This commit is contained in:
11 files changed
+12
-12
No files matched your search
@@ -66,7 +66,7 @@ if [[ "${langinfo[CODESET]}" = UTF-8 ]]; then
|
||||
PR_LRCORNER="┘"
|
||||
PR_URCORNER="┐"
|
||||
else
|
||||
typeset -A altchar
|
||||
typeset -g -A altchar
|
||||
set -A altchar ${(s..)terminfo[acsc]}
|
||||
# Some stuff to help us draw nice lines
|
||||
PR_SET_CHARSET="%{$terminfo[enacs]%}"
|
||||
|
||||
Reference in new issue
Block a user