Merge 957a8b4a44 into 12b879caf7
This commit is contained in:
commit
33b3f42a3c
|
|
@ -89,6 +89,10 @@ _zsh_highlight_main_add_region_highlight() {
|
|||
#
|
||||
# The result will be stored in REPLY.
|
||||
_zsh_highlight_main__type() {
|
||||
REPLY=$_zsh_highlight_command_type_cache[(e)$1]
|
||||
if [[ -n "$REPLY" ]]; then
|
||||
return
|
||||
fi
|
||||
if (( $#options_to_set )); then
|
||||
setopt localoptions $options_to_set;
|
||||
fi
|
||||
|
|
@ -113,6 +117,7 @@ _zsh_highlight_main__type() {
|
|||
if ! (( $+REPLY )); then
|
||||
REPLY="${$(LC_ALL=C builtin type -w -- $1 2>/dev/null)#*: }"
|
||||
fi
|
||||
_zsh_highlight_command_type_cache[(e)$1]=$REPLY
|
||||
}
|
||||
|
||||
# Check whether the first argument is a redirection operator token.
|
||||
|
|
|
|||
|
|
@ -322,6 +322,7 @@ _zsh_highlight_preexec_hook()
|
|||
{
|
||||
typeset -g _ZSH_HIGHLIGHT_PRIOR_BUFFER=
|
||||
typeset -gi _ZSH_HIGHLIGHT_PRIOR_CURSOR=
|
||||
_zsh_highlight_command_type_cache=()
|
||||
}
|
||||
autoload -U add-zsh-hook
|
||||
add-zsh-hook preexec _zsh_highlight_preexec_hook 2>/dev/null || {
|
||||
|
|
@ -333,3 +334,6 @@ zmodload zsh/parameter 2>/dev/null || true
|
|||
|
||||
# Initialize the array of active highlighters if needed.
|
||||
[[ $#ZSH_HIGHLIGHT_HIGHLIGHTERS -eq 0 ]] && ZSH_HIGHLIGHT_HIGHLIGHTERS=(main) || true
|
||||
|
||||
# Initialize command type cache
|
||||
typeset -A _zsh_highlight_command_type_cache
|
||||
|
|
|
|||
Loading…
Reference in New Issue