|
|
@ -127,8 +127,12 @@ _zsh_autosuggest_accept() {
|
|
|
|
max_cursor_pos=$((max_cursor_pos - 1))
|
|
|
|
max_cursor_pos=$((max_cursor_pos - 1))
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (( $CURSOR != $max_cursor_pos )); then
|
|
|
|
|
|
|
|
_zsh_autosuggest_invoke_original_widget $@
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Only accept if the cursor is at the end of the buffer
|
|
|
|
# Only accept if the cursor is at the end of the buffer
|
|
|
|
if (( $CURSOR == $max_cursor_pos )); then
|
|
|
|
|
|
|
|
# Add the suggestion to the buffer
|
|
|
|
# Add the suggestion to the buffer
|
|
|
|
BUFFER="$BUFFER$POSTDISPLAY"
|
|
|
|
BUFFER="$BUFFER$POSTDISPLAY"
|
|
|
|
|
|
|
|
|
|
|
@ -141,7 +145,6 @@ _zsh_autosuggest_accept() {
|
|
|
|
else
|
|
|
|
else
|
|
|
|
CURSOR=$#BUFFER
|
|
|
|
CURSOR=$#BUFFER
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_zsh_autosuggest_invoke_original_widget $@
|
|
|
|
_zsh_autosuggest_invoke_original_widget $@
|
|
|
|
}
|
|
|
|
}
|
|
|
|