zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
31.57k stars 1.88k forks source link

vi-forward-word results in duplicate completion #709

Open Spoons opened 2 years ago

Spoons commented 2 years ago

Thank you for this great project.

I'm finding that with zsh-autosuggestions and vi-mode, vi-forward-mode returns a duplicated completion. For example, completing ls .local/share/evolution:

start: ls .l # suggestion appears, trigger vi-forward-word ls .local/share/evolutionlocal/share/evolution

Occurs with zsh, zsh-autosuggestions, set -o vi, and no other configuration.

cloud-yu commented 1 year ago

same experience, but I found this may be caused by fast-syntax-highlight plugin. I got correct completion when disabled fast-syntax-highlighting

ericfreese commented 1 year ago

Yeah I'm not able to reproduce this so simply. There must be something else going on.

❯ zsh -df
ericfreese% echo $ZSH_VERSION
5.9
ericfreese% grep '^# v' /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
# v0.7.0
ericfreese% set -o vi
ericfreese% bindkey -M vicmd w
"w" vi-forward-word
ericfreese% source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
ericfreese% ls .local/share/
...
ericfreese% ls .l # then press esc and w
# It partially accepts the suggestion to `ls .local/` as I would expect