Wrap yank-pop.

As explained in #143 (which was a PR for #99), 'yank-pop' only works when the
previous widget has the ZLE_YANK flag, which means wrapping the 'yank' widget
breaks the 'yank-pop' widget (makes it a no-op).  However, that is a reason
against wrapping the 'yank' widget, but not against wrapping the 'yank-pop'
widget.  Indeed, if 'yank-pop' is wrapped but 'yank' isn't, then yank-pop
functions correctly and updates highlighting properly.

To unbreak yank-pop, either 'yank' should be excluded from wrapping, or one of
the fixes mentioned on issue #183 should be applied.
This commit is contained in:
Daniel Shahaf 2015-10-19 08:30:11 +00:00
parent fe4e893ce5
commit 766b350a7d

View File

@ -182,7 +182,7 @@ _zsh_highlight_bind_widgets()
# Override ZLE widgets to make them invoke _zsh_highlight.
local cur_widget
for cur_widget in ${${(f)"$(builtin zle -la)"}:#(.*|_*|orig-*|run-help|which-command|beep|yank-pop|set-local-history)}; do
for cur_widget in ${${(f)"$(builtin zle -la)"}:#(.*|_*|orig-*|run-help|which-command|beep|set-local-history)}; do
case $widgets[$cur_widget] in
# Already rebound event: do nothing.