If a suggestion is present, using the completion widgets _most_recent_file, _history-complete-newer and _history-complete-older does not clear the suggestion, even when the widgets are present in ZSH_AUTOSUGGEST_CLEAR_WIDGETS.
Steps to reproduce the behavior:
% zsh -df
% source path/to/zsh-autosuggestions.zsh
% autoload compinit && compinit # Load completion widgets
% source path/to # then hit Alt+/ to execute _history-complete-older
The suggestion should have be cleared when the history word is inserted.
The mentioned completion widgets are documented in zshcompsys(1) under 'Bindable Commands', and are added when running compinit.
It seems that these widgets are not wrapped by zsh-autosuggestions:
% zle -l | grep _history-complete
_history-complete-newer -C .complete-word _history_complete_word
_history-complete-older -C .complete-word _history_complete_word
Thanks for this. I think I copied the widget binding code from zsh-syntax-highlighting long ago which originally included the omission of widgets that start with _ but has since been changed. I think we can apply the same change here: https://github.com/zsh-users/zsh-syntax-highlighting/commit/ed33d2cb13884b298a996ceadfc94ae6ffd78825
Most helpful comment
Thanks for this. I think I copied the widget binding code from zsh-syntax-highlighting long ago which originally included the omission of widgets that start with
_but has since been changed. I think we can apply the same change here: https://github.com/zsh-users/zsh-syntax-highlighting/commit/ed33d2cb13884b298a996ceadfc94ae6ffd78825https://github.com/zsh-users/zsh-autosuggestions/blob/ae315ded4dba10685dbbafbfa2ff3c1aefeb490d/src/bind.zsh#L71