fix: resolve multiple bugs across git prompt, colorize, and globalias plugins

This commit is contained in:
Codebuff Contributor 2026-05-16 06:16:40 +06:00
commit c5fb48da9d
3 changed files with 14 additions and 5 deletions

View file

@ -90,6 +90,7 @@ colorize_less() {
# (e.g. when not scrolled to the bottom) while already the next file will be displayed.
local LESSOPEN="| zsh -c 'source \"$ZSH_COLORIZE_PLUGIN_PATH\"; \
ZSH_COLORIZE_TOOL=$ZSH_COLORIZE_TOOL ZSH_COLORIZE_STYLE=$ZSH_COLORIZE_STYLE \
ZSH_COLORIZE_CHROMA_FORMATTER=$ZSH_COLORIZE_CHROMA_FORMATTER \
colorize_cat %s 2> /dev/null'"
# LESSCLOSE will be set to prevent any errors by executing a user script

View file

@ -3,9 +3,13 @@ globalias() {
# (z) splits into words using shell parsing
# (A) makes it an array even if there's only one element
local word=${${(Az)LBUFFER}[-1]}
if [[ $GLOBALIAS_FILTER_VALUES[(Ie)$word] -eq 0 ]]; then
zle _expand_alias
zle expand-word
# Don't expand if the word looks like an environment variable assignment
# (e.g. DEBUG=1 or KEY="value") to avoid expanding aliases in env vars
if [[ $word != *"="* ]]; then
if [[ $GLOBALIAS_FILTER_VALUES[(Ie)$word] -eq 0 ]]; then
zle _expand_alias
zle expand-word
fi
fi
zle self-insert
}