zsh-users/zsh-history-substring-search — pull request #7 by vitahall (2012-01-11 03:29:32+00:00)
Title: Re-import updated widget-remapping code from zsh-syntax-highlighting

This brings in the several improvements since the code was initially
added for compatibility. In particular, this fixes widget conflicts with
existing functions and executables by prefixing all redefined widgets
with `_zsh_highlight_widget_`.

This is taken from commit bb0d575942760fe483790fe878ea43b1f781e2ca of
https://github.com/zsh-users/zsh-syntax-highlighting.git.

It's basically a copy-paste of the equivalent section. I didn't re-create any
of the more involved refactoring that's been done in zsh-syntax-highlighting
since; didn't think it needed it here.