summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2022-01-05 09:10:32 +0100
committerMarc Cornellà <hello@mcornella.com>2022-01-05 09:23:54 +0100
commitd3bb52d7d825f2a6ce2e1c76ca472b05c6f27b40 (patch)
treece376dce8b593ee56657bedb45c8c18b66a636c2 /themes
parent31d63ea884e8ef56a40bed8771cdd8d3aec131f9 (diff)
downloadzsh-d3bb52d7d825f2a6ce2e1c76ca472b05c6f27b40.tar.gz
zsh-d3bb52d7d825f2a6ce2e1c76ca472b05c6f27b40.tar.bz2
zsh-d3bb52d7d825f2a6ce2e1c76ca472b05c6f27b40.zip
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.
Diffstat (limited to 'themes')
-rw-r--r--themes/dieter.zsh-theme2
-rw-r--r--themes/jonathan.zsh-theme2
2 files changed, 2 insertions, 2 deletions
diff --git a/themes/dieter.zsh-theme b/themes/dieter.zsh-theme
index 58d9f88a9..83f2dcc7c 100644
--- a/themes/dieter.zsh-theme
+++ b/themes/dieter.zsh-theme
@@ -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")
diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme
index 11d799a84..e8c490884 100644
--- a/themes/jonathan.zsh-theme
+++ b/themes/jonathan.zsh-theme
@@ -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]%}"