mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-02-13 10:05:31 +08:00
parent
11c9081967
commit
d54b146d0e
@ -262,6 +262,13 @@ _zsh_highlight_bind_widgets()
|
|||||||
local -U widgets_to_bind
|
local -U widgets_to_bind
|
||||||
widgets_to_bind=(${${(k)widgets}:#(.*|run-help|which-command|beep|set-local-history|yank)})
|
widgets_to_bind=(${${(k)widgets}:#(.*|run-help|which-command|beep|set-local-history|yank)})
|
||||||
|
|
||||||
|
# Use zle-line-pre-redraw if available. Otherwise try binding widgets as fallback.
|
||||||
|
autoload -Uz is-at-least
|
||||||
|
if is-at-least 5.2; then
|
||||||
|
widgets_to_bind=(zle-line-pre-redraw)
|
||||||
|
else
|
||||||
|
widgets_to_bind=(${${(f)"$(builtin zle -la)"}:#(.*|orig-*|run-help|which-command|beep|set-local-history|yank)})
|
||||||
|
|
||||||
# Always wrap special zle-line-finish widget. This is needed to decide if the
|
# Always wrap special zle-line-finish widget. This is needed to decide if the
|
||||||
# current line ends and special highlighting logic needs to be applied.
|
# current line ends and special highlighting logic needs to be applied.
|
||||||
# E.g. remove cursor imprint, don't highlight partial paths, ...
|
# E.g. remove cursor imprint, don't highlight partial paths, ...
|
||||||
@ -270,6 +277,7 @@ _zsh_highlight_bind_widgets()
|
|||||||
# Always wrap special zle-isearch-update widget to be notified of updates in isearch.
|
# Always wrap special zle-isearch-update widget to be notified of updates in isearch.
|
||||||
# This is needed because we need to disable highlighting in that case.
|
# This is needed because we need to disable highlighting in that case.
|
||||||
widgets_to_bind+=(zle-isearch-update)
|
widgets_to_bind+=(zle-isearch-update)
|
||||||
|
fi
|
||||||
|
|
||||||
local cur_widget
|
local cur_widget
|
||||||
for cur_widget in $widgets_to_bind; do
|
for cur_widget in $widgets_to_bind; do
|
||||||
|
Loading…
Reference in New Issue
Block a user