mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
Fix #152 by escaping widget names inside evals
Solves problems when dealing with widget names with irregular characters such as those that come from `opp.zsh`.
This commit is contained in:
parent
011d8bdfd1
commit
945c660856
2 changed files with 8 additions and 8 deletions
|
@ -21,13 +21,13 @@ _zsh_autosuggest_bind_widget() {
|
||||||
|
|
||||||
# Built-in widget
|
# Built-in widget
|
||||||
builtin)
|
builtin)
|
||||||
eval "_zsh_autosuggest_orig_$widget() { zle .$widget }"
|
eval "_zsh_autosuggest_orig_${(q)widget}() { zle .${(q)widget} }"
|
||||||
zle -N $prefix$widget _zsh_autosuggest_orig_$widget
|
zle -N $prefix$widget _zsh_autosuggest_orig_$widget
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# Completion widget
|
# Completion widget
|
||||||
completion:*)
|
completion:*)
|
||||||
eval "zle -C $prefix$widget ${${widgets[$widget]#*:}/:/ }"
|
eval "zle -C $prefix${(q)widget} ${${widgets[$widget]#*:}/:/ }"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -37,8 +37,8 @@ _zsh_autosuggest_bind_widget() {
|
||||||
# correctly. $WIDGET cannot be trusted because other plugins call
|
# correctly. $WIDGET cannot be trusted because other plugins call
|
||||||
# zle without the `-w` flag (e.g. `zle self-insert` instead of
|
# zle without the `-w` flag (e.g. `zle self-insert` instead of
|
||||||
# `zle self-insert -w`).
|
# `zle self-insert -w`).
|
||||||
eval "_zsh_autosuggest_bound_$widget() {
|
eval "_zsh_autosuggest_bound_${(q)widget}() {
|
||||||
_zsh_autosuggest_widget_$autosuggest_action $prefix$widget \$@
|
_zsh_autosuggest_widget_$autosuggest_action $prefix${(q)widget} \$@
|
||||||
}"
|
}"
|
||||||
|
|
||||||
# Create the bound widget
|
# Create the bound widget
|
||||||
|
|
|
@ -132,13 +132,13 @@ _zsh_autosuggest_bind_widget() {
|
||||||
|
|
||||||
# Built-in widget
|
# Built-in widget
|
||||||
builtin)
|
builtin)
|
||||||
eval "_zsh_autosuggest_orig_$widget() { zle .$widget }"
|
eval "_zsh_autosuggest_orig_${(q)widget}() { zle .${(q)widget} }"
|
||||||
zle -N $prefix$widget _zsh_autosuggest_orig_$widget
|
zle -N $prefix$widget _zsh_autosuggest_orig_$widget
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# Completion widget
|
# Completion widget
|
||||||
completion:*)
|
completion:*)
|
||||||
eval "zle -C $prefix$widget ${${widgets[$widget]#*:}/:/ }"
|
eval "zle -C $prefix${(q)widget} ${${widgets[$widget]#*:}/:/ }"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -148,8 +148,8 @@ _zsh_autosuggest_bind_widget() {
|
||||||
# correctly. $WIDGET cannot be trusted because other plugins call
|
# correctly. $WIDGET cannot be trusted because other plugins call
|
||||||
# zle without the `-w` flag (e.g. `zle self-insert` instead of
|
# zle without the `-w` flag (e.g. `zle self-insert` instead of
|
||||||
# `zle self-insert -w`).
|
# `zle self-insert -w`).
|
||||||
eval "_zsh_autosuggest_bound_$widget() {
|
eval "_zsh_autosuggest_bound_${(q)widget}() {
|
||||||
_zsh_autosuggest_widget_$autosuggest_action $prefix$widget \$@
|
_zsh_autosuggest_widget_$autosuggest_action $prefix${(q)widget} \$@
|
||||||
}"
|
}"
|
||||||
|
|
||||||
# Create the bound widget
|
# Create the bound widget
|
||||||
|
|
Loading…
Reference in a new issue