From 5b9de6a5304ad5f74ccb5862122a23b9ba06f6e3 Mon Sep 17 00:00:00 2001 From: Carlo Sala <carlosalag@protonmail.com> Date: Mon, 19 Dec 2022 23:32:24 +0100 Subject: fix(init): remove duplicated check It was added due to #9039. See https://github.com/ohmyzsh/ohmyzsh/pull/11400#pullrequestreview-1223587420 --- oh-my-zsh.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'oh-my-zsh.sh') diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index e94c2f417..98bda8c8b 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -57,9 +57,7 @@ mkdir -p "$ZSH_CACHE_DIR/completions" (( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) # Check for updates on initial load... -if [[ "$DISABLE_AUTO_UPDATE" != true ]]; then - source "$ZSH/tools/check_for_upgrade.sh" -fi +source "$ZSH/tools/check_for_upgrade.sh" # Initializes Oh My Zsh -- cgit v1.2.3-70-g09d2 From d342b353e32091ef7384b86fd86b1a88dbd44609 Mon Sep 17 00:00:00 2001 From: Marc Cornellà <hello@mcornella.com> Date: Tue, 7 Mar 2023 18:49:17 +0100 Subject: 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. --- lib/theme-and-appearance.zsh | 10 ---------- oh-my-zsh.sh | 3 +++ 2 files changed, 3 insertions(+), 10 deletions(-) (limited to 'oh-my-zsh.sh') diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index 985d3bc11..e245570e3 100644 --- a/lib/theme-and-appearance.zsh +++ b/lib/theme-and-appearance.zsh @@ -81,13 +81,3 @@ if [[ -z "$LS_COLORS" ]]; then export LS_COLORS="di=34:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=37;41:sg=30;43:tw=30;42:ow=34;42:" fi fi - -# Take advantage of $LS_COLORS for completion as well. -function omz_set_completion_colors { - zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" - add-zsh-hook -d precmd omz_set_completion_colors - unfunction omz_set_completion_colors -} - -autoload -Uz add-zsh-hook -add-zsh-hook precmd omz_set_completion_colors 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}" -- cgit v1.2.3-70-g09d2