mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-01-30 09:47:13 +08:00
Rename variable with obsolete/confusing name
This commit is contained in:
parent
d4a9baa4ae
commit
e50d47ae1b
@ -143,7 +143,7 @@ _zsh_highlight-zle-buffer() {
|
|||||||
ZSH_PRIOR_HIGHLIGHTED_BUFFER=$BUFFER
|
ZSH_PRIOR_HIGHLIGHTED_BUFFER=$BUFFER
|
||||||
|
|
||||||
setopt localoptions extendedglob bareglobqual
|
setopt localoptions extendedglob bareglobqual
|
||||||
local colorize=true
|
local new_expression=true
|
||||||
local start_pos=0
|
local start_pos=0
|
||||||
local highlight_glob=true
|
local highlight_glob=true
|
||||||
local end_pos arg style
|
local end_pos arg style
|
||||||
@ -153,8 +153,8 @@ _zsh_highlight-zle-buffer() {
|
|||||||
[[ $start_pos -eq 0 && $arg = 'noglob' ]] && highlight_glob=false
|
[[ $start_pos -eq 0 && $arg = 'noglob' ]] && highlight_glob=false
|
||||||
((start_pos+=${#BUFFER[$start_pos+1,-1]}-${#${BUFFER[$start_pos+1,-1]##[[:space:]]#}}))
|
((start_pos+=${#BUFFER[$start_pos+1,-1]}-${#${BUFFER[$start_pos+1,-1]##[[:space:]]#}}))
|
||||||
((end_pos=$start_pos+${#arg}))
|
((end_pos=$start_pos+${#arg}))
|
||||||
if $colorize; then
|
if $new_expression; then
|
||||||
colorize=false
|
new_expression=false
|
||||||
res=$(LC_ALL=C builtin type -w $arg 2>/dev/null)
|
res=$(LC_ALL=C builtin type -w $arg 2>/dev/null)
|
||||||
case $res in
|
case $res in
|
||||||
*': reserved') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[reserved-word];;
|
*': reserved') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[reserved-word];;
|
||||||
@ -197,7 +197,7 @@ _zsh_highlight-zle-buffer() {
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
[[ $substr_color = 0 ]] && region_highlight+=("$start_pos $end_pos $style")
|
[[ $substr_color = 0 ]] && region_highlight+=("$start_pos $end_pos $style")
|
||||||
[[ ${${ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS[(r)${arg//|/\|}]:-}:+yes} = 'yes' ]] && colorize=true
|
[[ ${${ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS[(r)${arg//|/\|}]:-}:+yes} = 'yes' ]] && new_expression=true
|
||||||
start_pos=$end_pos
|
start_pos=$end_pos
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user