mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2025-12-22 15:52:31 +01:00
Fix deprecation warnings.
This commit is contained in:
parent
ebcfc46b72
commit
9788c2ee49
3 changed files with 18 additions and 24 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue