mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-02-13 10:05:31 +08:00
Prevent preexec() from being overridden by "_zhs_highlight". Note the spelling of "zhs"
This commit is contained in:
parent
bf4fe1f228
commit
bf15d2085d
@ -28,6 +28,17 @@
|
|||||||
# vim: ft=zsh sw=2 ts=2 et
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Workaround to overriding of preexec()
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# For some reason unidentified yet, someting goes wrong when sourcing this script twice
|
||||||
|
# The second time prexec() gets overwritten by "_zhs_highlight". This is a miss-spelled
|
||||||
|
# command which produces an error.
|
||||||
|
#
|
||||||
|
# The widget prexec() does not require modification anyway. So make a copy it here, which
|
||||||
|
# will be restored at the end of this script.
|
||||||
|
_zsh_highlight_old_preexec_definition=$functions[preexec]
|
||||||
|
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
# Core highlighting update system
|
# Core highlighting update system
|
||||||
@ -184,3 +195,6 @@ if [[ $#functions[zle-line-init] -eq 0 ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
zle -N zle-line-init
|
zle -N zle-line-init
|
||||||
|
|
||||||
|
# Restore preexec
|
||||||
|
functions[preexec]="$_zsh_highlight_old_preexec_definition"
|
||||||
|
Loading…
Reference in New Issue
Block a user