summaryrefslogtreecommitdiff
path: root/plugins/colored-man-pages/colored-man-pages.plugin.zsh
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 /plugins/colored-man-pages/colored-man-pages.plugin.zsh
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 'plugins/colored-man-pages/colored-man-pages.plugin.zsh')
-rw-r--r--plugins/colored-man-pages/colored-man-pages.plugin.zsh2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/colored-man-pages/colored-man-pages.plugin.zsh b/plugins/colored-man-pages/colored-man-pages.plugin.zsh
index 087ddce97..981992d88 100644
--- a/plugins/colored-man-pages/colored-man-pages.plugin.zsh
+++ b/plugins/colored-man-pages/colored-man-pages.plugin.zsh
@@ -22,7 +22,7 @@ less_termcap[ue]="${reset_color}"
0="${${(M)0:#/*}:-$PWD/$0}"
# Absolute path to this file's directory.
-typeset __colored_man_pages_dir="${0:A:h}"
+typeset -g __colored_man_pages_dir="${0:A:h}"
function colored() {
local -a environment