mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-11 22:02:31 +01:00
'main': Implement simple command type cache
This commit is contained in:
parent
12b879caf7
commit
957a8b4a44
2 changed files with 9 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue