2016-02-05 23:14:08 +01:00
2016-02-14 08:29:43 +01:00
#--------------------------------------------------------------------#
# Handle Deprecated Variables/Widgets #
#--------------------------------------------------------------------#
2016-02-05 23:14:08 +01:00
2016-02-14 08:32:25 +01:00
_zsh_autosuggest_deprecated_warning( ) {
>& 2 echo " zsh-autosuggestions: $@ "
}
2016-02-05 23:14:08 +01:00
_zsh_autosuggest_check_deprecated_config( ) {
if [ -n " $AUTOSUGGESTION_HIGHLIGHT_COLOR " ] ; then
_zsh_autosuggest_deprecated_warning "AUTOSUGGESTION_HIGHLIGHT_COLOR is deprecated. Use ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE instead."
[ -z " $ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE " ] && ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = $AUTOSUGGESTION_HIGHLIGHT_STYLE
unset AUTOSUGGESTION_HIGHLIGHT_STYLE
fi
if [ -n " $AUTOSUGGESTION_HIGHLIGHT_CURSOR " ] ; then
_zsh_autosuggest_deprecated_warning "AUTOSUGGESTION_HIGHLIGHT_CURSOR is deprecated."
unset AUTOSUGGESTION_HIGHLIGHT_CURSOR
fi
if [ -n " $AUTOSUGGESTION_ACCEPT_RIGHT_ARROW " ] ; then
_zsh_autosuggest_deprecated_warning "AUTOSUGGESTION_ACCEPT_RIGHT_ARROW is deprecated. The right arrow now accepts the suggestion by default."
unset AUTOSUGGESTION_ACCEPT_RIGHT_ARROW
fi
}
_zsh_autosuggest_deprecated_start_widget( ) {
2016-02-25 21:04:32 +01:00
_zsh_autosuggest_deprecated_warning "The autosuggest-start widget is deprecated. For more info, see the README at https://github.com/zsh-users/zsh-autosuggestions."
2016-02-14 08:32:25 +01:00
zle -D autosuggest-start
eval " zle-line-init() {
$( echo $functions [ ${ widgets [zle-line-init]#* : } ] | sed -e 's/zle autosuggest-start//g' )
} "
2016-02-05 23:14:08 +01:00
}
zle -N autosuggest-start _zsh_autosuggest_deprecated_start_widget