This commit is contained in:
Daniel McCormack 2026-05-18 10:08:38 +02:00 committed by GitHub
commit 9c56b48d27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 16 additions and 16 deletions

View file

@ -14,10 +14,10 @@ bindkey -M menuselect '^o' accept-and-infer-next-history
zstyle ':completion:*:*:*:*:*' menu select
# case insensitive (all), partial-word and substring completion
if [[ "$CASE_SENSITIVE" = true ]]; then
if [[ "${CASE_SENSITIVE:-}" = true ]]; then
zstyle ':completion:*' matcher-list 'r:|=*' 'l:|=* r:|=*'
else
if [[ "$HYPHEN_INSENSITIVE" = true ]]; then
if [[ "${HYPHEN_INSENSITIVE:-}" = true ]]; then
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]-_}={[:upper:][:lower:]_-}' 'r:|=*' 'l:|=* r:|=*'
else
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|=*' 'l:|=* r:|=*'

View file

@ -1,4 +1,4 @@
if [[ "$ENABLE_CORRECTION" == "true" ]]; then
if [[ "${ENABLE_CORRECTION:-}" == "true" ]]; then
alias cp='nocorrect cp'
alias man='nocorrect man'
alias mkdir='nocorrect mkdir'

View file

@ -147,13 +147,13 @@ local _style
if zstyle -t ':omz:alpha:lib:git' async-prompt \
|| { is-at-least 5.0.6 && zstyle -T ':omz:alpha:lib:git' async-prompt }; then
function git_prompt_info() {
if [[ -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]}" ]]; then
if [[ -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]:-}" ]]; then
echo -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]}"
fi
}
function git_prompt_status() {
if [[ -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]}" ]]; then
if [[ -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]:-}" ]]; then
echo -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]}"
fi
}
@ -162,13 +162,13 @@ if zstyle -t ':omz:alpha:lib:git' async-prompt \
# or any of the other prompt variables
function _defer_async_git_register() {
# Check if git_prompt_info is used in a prompt variable
case "${PS1}:${PS2}:${PS3}:${PS4}:${RPROMPT}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in
case "${PS1}:${PS2:-}:${PS3:-}:${PS4:-}:${RPROMPT:-}:${RPS1:-}:${RPS2:-}:${RPS3:-}:${RPS4:-}" in
*(\$\(git_prompt_info\)|\`git_prompt_info\`)*)
_omz_register_handler _omz_git_prompt_info
;;
esac
case "${PS1}:${PS2}:${PS3}:${PS4}:${RPROMPT}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in
case "${PS1}:${PS2:-}:${PS3:-}:${PS4:-}:${RPROMPT:-}:${RPS1:-}:${RPS2:-}:${RPS3:-}:${RPS4:-}" in
*(\$\(git_prompt_status\)|\`git_prompt_status\`)*)
_omz_register_handler _omz_git_prompt_status
;;

View file

@ -1,7 +1,7 @@
autoload -Uz is-at-least
# *-magic is known buggy in some versions; disable if so
if [[ $DISABLE_MAGIC_FUNCTIONS != true ]]; then
if [[ ${DISABLE_MAGIC_FUNCTIONS:-} != true ]]; then
for d in $fpath; do
if [[ -e "$d/url-quote-magic" ]]; then
if is-at-least 5.1; then

View file

@ -104,7 +104,7 @@ function omz_termsupport_preexec {
autoload -Uz add-zsh-hook
if [[ -z "$INSIDE_EMACS" || "$INSIDE_EMACS" = vterm ]]; then
if [[ -z "${INSIDE_EMACS:-}" || "$INSIDE_EMACS" = vterm ]]; then
add-zsh-hook precmd omz_termsupport_precmd
add-zsh-hook preexec omz_termsupport_preexec
fi
@ -122,7 +122,7 @@ fi
# As of May 2021 mlterm, PuTTY, rxvt, screen, termux & xterm simply ignore the unknown OSC.
# Don't define the function if we're inside Emacs or in an SSH session (#11696)
if [[ -n "$INSIDE_EMACS" || -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then
if [[ -n "${INSIDE_EMACS:-}" || -n "${SSH_CLIENT:-}" || -n "${SSH_TTY:-}" ]]; then
return
fi
@ -152,7 +152,7 @@ function omz_termsupport_cwd {
URL_PATH="$(omz_urlencode -P $PWD)" || return 1
# Konsole errors if the HOST is provided
[[ -z "$KONSOLE_PROFILE_NAME" && -z "$KONSOLE_DBUS_SESSION" ]] || URL_HOST=""
[[ -z "${KONSOLE_PROFILE_NAME:-}" && -z "${KONSOLE_DBUS_SESSION:-}" ]] || URL_HOST=""
# common control sequence (OSC 7) to set current host and path
printf "\e]7;file://%s%s\e\\" "${URL_HOST}" "${URL_PATH}"

View file

@ -21,7 +21,7 @@ if command diff --color /dev/null{,} &>/dev/null; then
fi
# Don't set ls coloring if disabled
[[ "$DISABLE_LS_COLORS" != true ]] || return 0
[[ "${DISABLE_LS_COLORS:-}" != true ]] || return 0
# Default coloring for BSD-based ls
export LSCOLORS="Gxfxcxdxbxegedabagacad"

View file

@ -121,7 +121,7 @@ if ! command grep -q -Fx "$zcompdump_revision" "$ZSH_COMPDUMP" 2>/dev/null \
zcompdump_refresh=1
fi
if [[ "$ZSH_DISABLE_COMPFIX" != true ]]; then
if [[ "${ZSH_DISABLE_COMPFIX:-}" != true ]]; then
source "$ZSH/lib/compfix.zsh"
# Load only from secure directories
compinit -i -d "$ZSH_COMPDUMP"

View file

@ -66,7 +66,7 @@ if [[ "$OSTYPE" = darwin* ]]; then
if [[ "${BATTERY_SHOW_WATTS}" = "true" ]] ; then
watts=$(get_charger_power)
fi
echo "${watts}${BATTERY_CHARGING-⚡️}"
echo "${watts:-}${BATTERY_CHARGING-⚡️}"
fi
}

View file

@ -15,8 +15,8 @@ zstyle -s ':omz:update' mode update_mode || {
update_mode=prompt
# If the mode zstyle setting is not set, support old-style settings
[[ "$DISABLE_UPDATE_PROMPT" != true ]] || update_mode=auto
[[ "$DISABLE_AUTO_UPDATE" != true ]] || update_mode=disabled
[[ "${DISABLE_UPDATE_PROMPT:-}" != true ]] || update_mode=auto
[[ "${DISABLE_AUTO_UPDATE:-}" != true ]] || update_mode=disabled
}
# Cancel update if: