mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-12-23 10:21:15 +01:00
Fix deprecation warnings.
This commit is contained in:
parent
ebcfc46b72
commit
9788c2ee49
3 changed files with 18 additions and 24 deletions
|
@ -55,7 +55,7 @@ _zsh_autosuggest_bind_widgets() {
|
|||
local widget;
|
||||
|
||||
# Find every widget we might want to bind and bind it appropriately
|
||||
for widget in ${${(f)"$(builtin zle -la)"}:#(.*|_*|orig-*|autosuggest-*|$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX*|run-help|which-command|beep|set-local-history|yank)}; do
|
||||
for widget in ${${(f)"$(builtin zle -la)"}:#(.*|_*|orig-*|autosuggest-*|$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX*|zle-line-*|run-help|which-command|beep|set-local-history|yank)}; do
|
||||
if [ ${ZSH_AUTOSUGGEST_MODIFY_WIDGETS[(r)$widget]} ]; then
|
||||
_zsh_autosuggest_bind_widget $widget _zsh_autosuggest_modify
|
||||
elif [ ${ZSH_AUTOSUGGEST_CLEAR_WIDGETS[(r)$widget]} ]; then
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
# Handle Deprecated Variables/Widgets #
|
||||
#--------------------------------------------------------------------#
|
||||
|
||||
unset _ZSH_AUTOSUGGEST_DEPRECATED_START_WIDGET_WARNING_SHOWN
|
||||
_zsh_autosuggest_deprecated_warning() {
|
||||
>&2 echo "zsh-autosuggestions: $@"
|
||||
}
|
||||
|
||||
_zsh_autosuggest_check_deprecated_config() {
|
||||
if [ -n "$AUTOSUGGESTION_HIGHLIGHT_COLOR" ]; then
|
||||
|
@ -23,17 +25,12 @@ _zsh_autosuggest_check_deprecated_config() {
|
|||
fi
|
||||
}
|
||||
|
||||
_zsh_autosuggest_deprecated_warning() {
|
||||
>&2 echo "zsh-autosuggestions: $@"
|
||||
}
|
||||
|
||||
_zsh_autosuggest_deprecated_start_widget() {
|
||||
if [ -z "$_ZSH_AUTOSUGGEST_DEPRECATED_START_WIDGET_WARNING_SHOWN" ]; then
|
||||
_zsh_autosuggest_deprecated_warning "The autosuggest-start widget is deprecated. Use the autosuggest_start function instead. For more info, see README at https://github.com/tarruda/zsh-autosuggestions."
|
||||
_ZSH_AUTOSUGGEST_DEPRECATED_START_WIDGET_WARNING_SHOWN=true
|
||||
fi
|
||||
|
||||
autosuggest_start
|
||||
_zsh_autosuggest_deprecated_warning "The autosuggest-start widget is deprecated. For more info, see the README at https://github.com/tarruda/zsh-autosuggestions."
|
||||
zle -D autosuggest-start
|
||||
eval "zle-line-init() {
|
||||
$(echo $functions[${widgets[zle-line-init]#*:}] | sed -e 's/zle autosuggest-start//g')
|
||||
}"
|
||||
}
|
||||
|
||||
zle -N autosuggest-start _zsh_autosuggest_deprecated_start_widget
|
||||
|
|
|
@ -90,7 +90,9 @@ ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS=(
|
|||
# Handle Deprecated Variables/Widgets #
|
||||
#--------------------------------------------------------------------#
|
||||
|
||||
unset _ZSH_AUTOSUGGEST_DEPRECATED_START_WIDGET_WARNING_SHOWN
|
||||
_zsh_autosuggest_deprecated_warning() {
|
||||
>&2 echo "zsh-autosuggestions: $@"
|
||||
}
|
||||
|
||||
_zsh_autosuggest_check_deprecated_config() {
|
||||
if [ -n "$AUTOSUGGESTION_HIGHLIGHT_COLOR" ]; then
|
||||
|
@ -110,17 +112,12 @@ _zsh_autosuggest_check_deprecated_config() {
|
|||
fi
|
||||
}
|
||||
|
||||
_zsh_autosuggest_deprecated_warning() {
|
||||
>&2 echo "zsh-autosuggestions: $@"
|
||||
}
|
||||
|
||||
_zsh_autosuggest_deprecated_start_widget() {
|
||||
if [ -z "$_ZSH_AUTOSUGGEST_DEPRECATED_START_WIDGET_WARNING_SHOWN" ]; then
|
||||
_zsh_autosuggest_deprecated_warning "The autosuggest-start widget is deprecated. Use the autosuggest_start function instead. For more info, see README at https://github.com/tarruda/zsh-autosuggestions."
|
||||
_ZSH_AUTOSUGGEST_DEPRECATED_START_WIDGET_WARNING_SHOWN=true
|
||||
fi
|
||||
|
||||
autosuggest_start
|
||||
_zsh_autosuggest_deprecated_warning "The autosuggest-start widget is deprecated. For more info, see the README at https://github.com/tarruda/zsh-autosuggestions."
|
||||
zle -D autosuggest-start
|
||||
eval "zle-line-init() {
|
||||
$(echo $functions[${widgets[zle-line-init]#*:}] | sed -e 's/zle autosuggest-start//g')
|
||||
}"
|
||||
}
|
||||
|
||||
zle -N autosuggest-start _zsh_autosuggest_deprecated_start_widget
|
||||
|
@ -181,7 +178,7 @@ _zsh_autosuggest_bind_widgets() {
|
|||
local widget;
|
||||
|
||||
# Find every widget we might want to bind and bind it appropriately
|
||||
for widget in ${${(f)"$(builtin zle -la)"}:#(.*|_*|orig-*|autosuggest-*|$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX*|run-help|which-command|beep|set-local-history|yank)}; do
|
||||
for widget in ${${(f)"$(builtin zle -la)"}:#(.*|_*|orig-*|autosuggest-*|$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX*|zle-line-*|run-help|which-command|beep|set-local-history|yank)}; do
|
||||
if [ ${ZSH_AUTOSUGGEST_MODIFY_WIDGETS[(r)$widget]} ]; then
|
||||
_zsh_autosuggest_bind_widget $widget _zsh_autosuggest_modify
|
||||
elif [ ${ZSH_AUTOSUGGEST_CLEAR_WIDGETS[(r)$widget]} ]; then
|
||||
|
|
Loading…
Reference in a new issue