mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2025-12-06 07:20:40 +01: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:
@@ -6,7 +6,7 @@
|
||||
# The exit code visual cues will only display once.
|
||||
# (i.e. they will be reset, even if you hit enter a few times on empty command prompts)
|
||||
|
||||
typeset -A host_repr
|
||||
typeset -g -A host_repr
|
||||
|
||||
# translate hostnames into shortened, colorcoded strings
|
||||
host_repr=('dieter-ws-a7n8x-arch' "%{$fg_bold[green]%}ws" 'dieter-p4sci-arch' "%{$fg_bold[blue]%}p4")
|
||||
|
||||
@@ -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