Fix a few issues relating to failing tests

This commit is contained in:
Kaleb Elwert 2017-07-17 14:20:33 -07:00
parent 90d732fd78
commit 73ab50b974
2 changed files with 6 additions and 6 deletions

View file

@ -88,13 +88,13 @@ _zsh_autosuggest_bind_widgets() {
# Find every widget we might want to bind and bind it appropriately # Find every widget we might want to bind and bind it appropriately
for widget in ${${(f)"$(builtin zle -la)"}:#${(j:|:)~ignore_widgets}}; do for widget in ${${(f)"$(builtin zle -la)"}:#${(j:|:)~ignore_widgets}}; do
if [[ ${ZSH_AUTOSUGGEST_CLEAR_WIDGETS[(r)$widget]} ]]; then if [[ -n ${ZSH_AUTOSUGGEST_CLEAR_WIDGETS[(r)$widget]} ]]; then
_zsh_autosuggest_bind_widget $widget clear _zsh_autosuggest_bind_widget $widget clear
elif [[ ${ZSH_AUTOSUGGEST_ACCEPT_WIDGETS[(r)$widget]} ]]; then elif [[ -n ${ZSH_AUTOSUGGEST_ACCEPT_WIDGETS[(r)$widget]} ]]; then
_zsh_autosuggest_bind_widget $widget accept _zsh_autosuggest_bind_widget $widget accept
elif [[ ${ZSH_AUTOSUGGEST_EXECUTE_WIDGETS[(r)$widget]} ]]; then elif [[ -n ${ZSH_AUTOSUGGEST_EXECUTE_WIDGETS[(r)$widget]} ]]; then
_zsh_autosuggest_bind_widget $widget execute _zsh_autosuggest_bind_widget $widget execute
elif [[ ${ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS[(r)$widget]} ]]; then elif [[ -n ${ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS[(r)$widget]} ]]; then
_zsh_autosuggest_bind_widget $widget partial_accept _zsh_autosuggest_bind_widget $widget partial_accept
else else
# Assume any unspecified widget might modify the buffer # Assume any unspecified widget might modify the buffer
@ -112,7 +112,7 @@ _zsh_autosuggest_invoke_original_widget() {
shift shift
if [[ -n $widgets[$original_widget_name] ]]; then if (( ${+widgets[$original_widget_name]} )); then
zle $original_widget_name -- $@ zle $original_widget_name -- $@
fi fi
} }

View file

@ -82,7 +82,7 @@ _zsh_autosuggest_modify() {
# Get a new suggestion if the buffer is not empty after modification # Get a new suggestion if the buffer is not empty after modification
if [[ $#BUFFER > 0 ]]; then if [[ $#BUFFER > 0 ]]; then
if [[ -z "$ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE" ]] || (( "$#BUFFER" <= "$ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE" )); then if [[ -z "$ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE" ]] || [[ "$#BUFFER" -le "$ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE" ]]; then
_zsh_autosuggest_fetch _zsh_autosuggest_fetch
fi fi
fi fi