diff options
author | Marc Cornellà <hello@mcornella.com> | 2023-03-07 18:49:17 +0100 |
---|---|---|
committer | Marc Cornellà <hello@mcornella.com> | 2023-03-07 18:54:06 +0100 |
commit | d342b353e32091ef7384b86fd86b1a88dbd44609 (patch) | |
tree | 82ec02e507360ac3d60168aba6727f8d44410d73 /oh-my-zsh.sh | |
parent | 46fd7972a2170388c9b8e9f6e58d6c8408ad4904 (diff) | |
download | zsh-d342b353e32091ef7384b86fd86b1a88dbd44609.tar.gz zsh-d342b353e32091ef7384b86fd86b1a88dbd44609.tar.bz2 zsh-d342b353e32091ef7384b86fd86b1a88dbd44609.zip |
fix(init): set completion colors on theme load, not with `precmd`
This fixes an edge case where the user actually sets
zstyle ':completion:*' list-colors
in their zshrc, but the previous code used a precmd hook, which would
override the user changes. With this change our modifications will be
set in the init script, after the theme loads, so that later changes
can affect our defaults.
Note that this will not be run for users on plugin managers, as these
don't generally run our init script.
Diffstat (limited to 'oh-my-zsh.sh')
-rw-r--r-- | oh-my-zsh.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 98bda8c8b..363cfca8b 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -189,3 +189,6 @@ if [[ -n "$ZSH_THEME" ]]; then echo "[oh-my-zsh] theme '$ZSH_THEME' not found" fi fi + +# set completion colors to be the same as `ls`, after theme has been loaded +[[ -z "$LS_COLORS" ]] || zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" |