mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
Merge pull request #501 from zsh-users/fixes/more-specific-widget-ignore
Be more specific about the built-in widgets we want to avoid wrapping
This commit is contained in:
commit
e3897c25c0
3 changed files with 36 additions and 20 deletions
|
@ -69,7 +69,7 @@ _zsh_autosuggest_bind_widgets() {
|
||||||
ignore_widgets=(
|
ignore_widgets=(
|
||||||
.\*
|
.\*
|
||||||
_\*
|
_\*
|
||||||
autosuggest-\*
|
${_ZSH_AUTOSUGGEST_BUILTIN_ACTIONS/#/autosuggest-}
|
||||||
$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX\*
|
$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX\*
|
||||||
$ZSH_AUTOSUGGEST_IGNORE_WIDGETS
|
$ZSH_AUTOSUGGEST_IGNORE_WIDGETS
|
||||||
)
|
)
|
||||||
|
|
|
@ -205,8 +205,21 @@ _zsh_autosuggest_partial_accept() {
|
||||||
}
|
}
|
||||||
|
|
||||||
() {
|
() {
|
||||||
|
typeset -ga _ZSH_AUTOSUGGEST_BUILTIN_ACTIONS
|
||||||
|
|
||||||
|
_ZSH_AUTOSUGGEST_BUILTIN_ACTIONS=(
|
||||||
|
clear
|
||||||
|
fetch
|
||||||
|
suggest
|
||||||
|
accept
|
||||||
|
execute
|
||||||
|
enable
|
||||||
|
disable
|
||||||
|
toggle
|
||||||
|
)
|
||||||
|
|
||||||
local action
|
local action
|
||||||
for action in clear modify fetch suggest accept partial_accept execute enable disable toggle; do
|
for action in $_ZSH_AUTOSUGGEST_BUILTIN_ACTIONS modify partial_accept; do
|
||||||
eval "_zsh_autosuggest_widget_$action() {
|
eval "_zsh_autosuggest_widget_$action() {
|
||||||
local -i retval
|
local -i retval
|
||||||
|
|
||||||
|
@ -223,12 +236,7 @@ _zsh_autosuggest_partial_accept() {
|
||||||
}"
|
}"
|
||||||
done
|
done
|
||||||
|
|
||||||
zle -N autosuggest-fetch _zsh_autosuggest_widget_fetch
|
for action in $_ZSH_AUTOSUGGEST_BUILTIN_ACTIONS; do
|
||||||
zle -N autosuggest-suggest _zsh_autosuggest_widget_suggest
|
zle -N autosuggest-$action _zsh_autosuggest_widget_$action
|
||||||
zle -N autosuggest-accept _zsh_autosuggest_widget_accept
|
done
|
||||||
zle -N autosuggest-clear _zsh_autosuggest_widget_clear
|
|
||||||
zle -N autosuggest-execute _zsh_autosuggest_widget_execute
|
|
||||||
zle -N autosuggest-enable _zsh_autosuggest_widget_enable
|
|
||||||
zle -N autosuggest-disable _zsh_autosuggest_widget_disable
|
|
||||||
zle -N autosuggest-toggle _zsh_autosuggest_widget_toggle
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,7 +199,7 @@ _zsh_autosuggest_bind_widgets() {
|
||||||
ignore_widgets=(
|
ignore_widgets=(
|
||||||
.\*
|
.\*
|
||||||
_\*
|
_\*
|
||||||
autosuggest-\*
|
${_ZSH_AUTOSUGGEST_BUILTIN_ACTIONS/#/autosuggest-}
|
||||||
$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX\*
|
$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX\*
|
||||||
$ZSH_AUTOSUGGEST_IGNORE_WIDGETS
|
$ZSH_AUTOSUGGEST_IGNORE_WIDGETS
|
||||||
)
|
)
|
||||||
|
@ -467,8 +467,21 @@ _zsh_autosuggest_partial_accept() {
|
||||||
}
|
}
|
||||||
|
|
||||||
() {
|
() {
|
||||||
|
typeset -ga _ZSH_AUTOSUGGEST_BUILTIN_ACTIONS
|
||||||
|
|
||||||
|
_ZSH_AUTOSUGGEST_BUILTIN_ACTIONS=(
|
||||||
|
clear
|
||||||
|
fetch
|
||||||
|
suggest
|
||||||
|
accept
|
||||||
|
execute
|
||||||
|
enable
|
||||||
|
disable
|
||||||
|
toggle
|
||||||
|
)
|
||||||
|
|
||||||
local action
|
local action
|
||||||
for action in clear modify fetch suggest accept partial_accept execute enable disable toggle; do
|
for action in $_ZSH_AUTOSUGGEST_BUILTIN_ACTIONS modify partial_accept; do
|
||||||
eval "_zsh_autosuggest_widget_$action() {
|
eval "_zsh_autosuggest_widget_$action() {
|
||||||
local -i retval
|
local -i retval
|
||||||
|
|
||||||
|
@ -485,14 +498,9 @@ _zsh_autosuggest_partial_accept() {
|
||||||
}"
|
}"
|
||||||
done
|
done
|
||||||
|
|
||||||
zle -N autosuggest-fetch _zsh_autosuggest_widget_fetch
|
for action in $_ZSH_AUTOSUGGEST_BUILTIN_ACTIONS; do
|
||||||
zle -N autosuggest-suggest _zsh_autosuggest_widget_suggest
|
zle -N autosuggest-$action _zsh_autosuggest_widget_$action
|
||||||
zle -N autosuggest-accept _zsh_autosuggest_widget_accept
|
done
|
||||||
zle -N autosuggest-clear _zsh_autosuggest_widget_clear
|
|
||||||
zle -N autosuggest-execute _zsh_autosuggest_widget_execute
|
|
||||||
zle -N autosuggest-enable _zsh_autosuggest_widget_enable
|
|
||||||
zle -N autosuggest-disable _zsh_autosuggest_widget_disable
|
|
||||||
zle -N autosuggest-toggle _zsh_autosuggest_widget_toggle
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#--------------------------------------------------------------------#
|
#--------------------------------------------------------------------#
|
||||||
|
|
Loading…
Reference in a new issue