Zsh-autosuggestions: Suggestion not cleared on bindable completion commands

Created on 9 May 2020  路  1Comment  路  Source: zsh-users/zsh-autosuggestions

Describe the bug

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.

To Reproduce

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

Expected behavior

The suggestion should have be cleared when the history word is inserted.

Desktop

  • OS + distribution: Arch Linux 2020.03.01
  • Zsh version: 5.8
  • Plugin version: 0.6.4

Additional context

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
bug

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/ed33d2cb13884b298a996ceadfc94ae6ffd78825

https://github.com/zsh-users/zsh-autosuggestions/blob/ae315ded4dba10685dbbafbfa2ff3c1aefeb490d/src/bind.zsh#L71

>All comments

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

https://github.com/zsh-users/zsh-autosuggestions/blob/ae315ded4dba10685dbbafbfa2ff3c1aefeb490d/src/bind.zsh#L71

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dipam7 picture dipam7  路  3Comments

metalmac picture metalmac  路  4Comments

kergoth picture kergoth  路  3Comments

daniele-orlando picture daniele-orlando  路  6Comments

OmeGak picture OmeGak  路  3Comments