Open sgleizes opened 4 years ago
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
I've applied the patch locally to zsh-autosuggestions.zsh
, however this doesn't fix the problem for me. The suggestion is still shown after a history word was inserted.
However, it seems that the widgets are now wrapped correctly?
Before:
% zle -l | grep _history-complete
_history-complete-newer -C .complete-word _history_complete_word
_history-complete-older -C .complete-word _history_complete_word
After:
% zle -l | grep _history-complete
_history-complete-newer (_zsh_autosuggest_bound_1__history-complete-newer)
_history-complete-older (_zsh_autosuggest_bound_1__history-complete-older)
autosuggest-orig-1-_history-complete-newer -C .complete-word _history_complete_word
autosuggest-orig-1-_history-complete-older -C .complete-word _history_complete_word
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 inZSH_AUTOSUGGEST_CLEAR_WIDGETS
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The suggestion should have be cleared when the history word is inserted.
Desktop
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: