zsh-autocomplete
zsh-autocomplete copied to clipboard
Loading select-word-style breaks .autocomplete.zle-flags
Environment
apple darwin21.3.0 /usr/local/bin/zsh /usr/local/bin/zsh zsh-5.9-0-g73d3173 f52f45a (HEAD, origin/main, origin/HEAD, main) Change precmd to chpwd for zlua
- Operating system: macOS
- Terminal emulator: iTerm2
Steps to reproduce
- Run
autoload -Uz select-word-style; select-word-style normal
- Type a few words (aaa bbb ccc)
- Go to the beginning of the line
- Do kill-word (M-d) twice
- Paste (C-y)
- See only the last word (
bbb
) get pasted instead of the last two concatenated (aaa bbb
)
Without loading either select-word-style or zsh-autocomplete, I get the expected result.
@knu Thanks for reporting. Since you know where the problem is, would you mind submitting a pull request? 🙂
@marlonrichert Unfortunately I'm yet to identify where the problem is. As long as I observe, select-word-style redefines the widgets kill-word
/backward-kill-word
but they should still match *kill-*~vi-*
, so the "kill" flag should be set by .autocomplete.zle-flags
. 🤔
It's a bug in kill-word-match
. It relies on $LASTWIDGET
to check if the last keystroke executed a kill command, but that doesn't work when a zle-line-pre-redraw
hook widget has been installed. Please report it on the official zsh-workers
mailing list.
As an alternative to select-word-style
, I would recommend my Zsh Edit plugin. It works a lot better than select-word-style
in general.