This commit is contained in:
Stanislav Seletskiy 2016-10-18 02:38:06 +00:00 committed by GitHub
commit ace6ccfc3f
3 changed files with 10 additions and 0 deletions

View File

@ -9,6 +9,10 @@ _zsh_autosuggest_bind_widget() {
local autosuggest_action=$2 local autosuggest_action=$2
local prefix=$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX local prefix=$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX
if zle -l $prefix$widget; then
return
fi
# Save a reference to the original widget # Save a reference to the original widget
case $widgets[$widget] in case $widgets[$widget] in
# Already bound # Already bound

View File

@ -10,4 +10,5 @@ _zsh_autosuggest_start() {
} }
autoload -Uz add-zsh-hook autoload -Uz add-zsh-hook
add-zsh-hook -d precmd _zsh_autosuggest_start
add-zsh-hook precmd _zsh_autosuggest_start add-zsh-hook precmd _zsh_autosuggest_start

View File

@ -133,6 +133,10 @@ _zsh_autosuggest_bind_widget() {
local autosuggest_action=$2 local autosuggest_action=$2
local prefix=$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX local prefix=$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX
if zle -l $prefix$widget; then
return
fi
# Save a reference to the original widget # Save a reference to the original widget
case $widgets[$widget] in case $widgets[$widget] in
# Already bound # Already bound
@ -470,4 +474,5 @@ _zsh_autosuggest_start() {
} }
autoload -Uz add-zsh-hook autoload -Uz add-zsh-hook
add-zsh-hook -d precmd _zsh_autosuggest_start
add-zsh-hook precmd _zsh_autosuggest_start add-zsh-hook precmd _zsh_autosuggest_start