Offer suggestion only if cursor is at end of line

https://github.com/zsh-users/zsh-autosuggestions/issues/343
This commit is contained in:
Martin Väth 2018-06-18 19:58:06 +02:00
parent 3f4c2acd53
commit 2d0806a362

View file

@ -379,6 +379,7 @@ _zsh_autosuggest_modify() {
# Fetch a new suggestion based on what's currently in the buffer # Fetch a new suggestion based on what's currently in the buffer
_zsh_autosuggest_fetch() { _zsh_autosuggest_fetch() {
[[ $CURSOR -eq $#BUFFER ]] || return 0
if [[ -n "${ZSH_AUTOSUGGEST_USE_ASYNC+x}" ]]; then if [[ -n "${ZSH_AUTOSUGGEST_USE_ASYNC+x}" ]]; then
_zsh_autosuggest_async_request "$BUFFER" _zsh_autosuggest_async_request "$BUFFER"
else else