mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
940e10a691
This fixes a small issue in src/widgets.zsh which makes it so if you alias [ to g[ (as is done in prezto if the gnu-utility module is loaded) autosuggestions would fail. The documentation for GNU test mentions that -o and -a should be avoided if possible because it's not very clear. Also, with zsh and [[ -o actually tests if an option is set, which makes this option even more confusing.
24 lines
866 B
Bash
24 lines
866 B
Bash
|
|
#--------------------------------------------------------------------#
|
|
# Start #
|
|
#--------------------------------------------------------------------#
|
|
|
|
# Start the autosuggestion widgets
|
|
_zsh_autosuggest_start() {
|
|
add-zsh-hook -d precmd _zsh_autosuggest_start
|
|
|
|
_zsh_autosuggest_bind_widgets
|
|
|
|
# Re-bind widgets on every precmd to ensure we wrap other wrappers.
|
|
# Specifically, highlighting breaks if our widgets are wrapped by
|
|
# zsh-syntax-highlighting widgets. This also allows modifications
|
|
# to the widget list variables to take effect on the next precmd.
|
|
add-zsh-hook precmd _zsh_autosuggest_bind_widgets
|
|
|
|
if [[ -n "${ZSH_AUTOSUGGEST_USE_ASYNC+x}" ]]; then
|
|
_zsh_autosuggest_async_start
|
|
fi
|
|
}
|
|
|
|
# Start the autosuggestion widgets on the next precmd
|
|
add-zsh-hook precmd _zsh_autosuggest_start
|