zsh-autosuggestions
zsh-autosuggestions copied to clipboard
`zle` widgets starting with `_` are ignord in `ZSH_AUTOSUGGEST_CLEAR_WIDGETS`
Describe the bug
Any widget that has a name starting with an underscore will not cause the prompt to be cleared. I'm not sure if this is intended behavior, but it took me quite a while to figure out why some widgets were not clearing my prompt.
To Reproduce
Steps to reproduce the behavior:
function _test() {}
zle -N test-widget _test
zle -N _test-widget _test
bindkey "^a" test-widget
bindkey "^b" _test-widget
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=('test-widget')
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=('_test-widget')
Trigger any suggestion. On pressing ^a, the suggestion is cleared, on ^b it is not.
Expected behavior
Any widget name should be able to work. Other zsh plugins I'm using add widgets that start with _, which means I currently have to rebind them to let them clear the suggestions.
Desktop
- OS + distribution:
NixOS 23.05 - Zsh version:
5.9 - Plugin version:
v0.7.0