Update for pre-redraw hook enabled Fast-Syntax-Highlighting

This commit is contained in:
Sebastian Gniazdowski 2018-10-09 12:54:48 +02:00
parent 305ba45bc5
commit 159aaa5e72

View file

@ -357,6 +357,16 @@ if [[ "$__hsmw_hcw_call_count" -eq "1" ]]; then
zle -N delete-char _hsmw_delete_char
(( __hsmw_reset_prompt_protect )) && zle -N reset-prompt _hsmw_reset_prompt
if (( ${+functions[azhw:zle-line-pre-redraw]} )); then
functions[zle-line-pre-redraw-bkp]=${functions[azhw:zle-line-pre-redraw]}
functions[azhw:zle-line-pre-redraw]=":"
fi
if (( ${+functions[azhw:zle-line-finish]} )); then
functions[zle-line-finish-bkp]=${functions[azhw:zle-line-finish]}
functions[azhw:zle-line-finish]=":"
fi
# OMZ does funny things with zle-keymap-select
zle -la zle-keymap-select && {
zle -A zle-keymap-select hsmw-saved-zle-keymap-select
@ -438,6 +448,14 @@ if [[ "$__hsmw_hcw_call_count" -eq "1" ]]; then
zle -A hsmw-saved-"$pup_widget" "$pup_widget"
zle -D hsmw-saved-"$pdown_widget" hsmw-saved-"$pup_widget"
if (( ${+functions[azhw:zle-line-pre-redraw]} )); then
functions[azhw:zle-line-pre-redraw]=${functions[zle-line-pre-redraw-bkp]}
fi
if (( ${+functions[azhw:zle-line-finish]} )); then
functions[azhw:zle-line-finish]=${functions[zle-line-finish-bkp]}
fi
# Full reinitialisation at next call
__hsmw_hcw_call_count="0"