This commit is contained in:
Manish Tiwari 2026-08-21 21:19:22 -05:00 committed by GitHub
commit 68d53daf07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 3 deletions

View File

@ -4,6 +4,11 @@
- Highlight `&>` `>&|` `>&!` `&>|` and `&>!` as redirection. - Highlight `&>` `>&|` `>&!` `&>|` and `&>!` as redirection.
[#942] [#942]
- Fixed: aliases were restored via a plain (non-`builtin`) call to `alias`,
so if the user had overridden/aliased `alias` itself, restoration could
fail silently.
[#972]
# Changes in 0.8.0 # Changes in 0.8.0

View File

@ -579,9 +579,16 @@ if (( $+X_ZSH_HIGHLIGHT_DIRS_BLACKLIST )); then
unset X_ZSH_HIGHLIGHT_DIRS_BLACKLIST unset X_ZSH_HIGHLIGHT_DIRS_BLACKLIST
fi fi
# Restore the aliases we unned # Restore the aliases that were unaliased above (via 'builtin unalias').
eval "$zsh_highlight__aliases" #
builtin unset zsh_highlight__aliases # We use 'builtin' here (and not just when capturing them above) in case the
# 'alias' command has itself been aliased or overridden by the user; see
# issue #972.
typeset zsh_highlight__alias
for zsh_highlight__alias in ${(f)zsh_highlight__aliases}; do
eval "builtin $zsh_highlight__alias"
done
builtin unset zsh_highlight__aliases zsh_highlight__alias
# Set $?. # Set $?.
true true