Allow wrapping widgets whose name start with _ (underscore) #749
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi folks,
When creating a zle widget whose name starts with
_
, it is ignored by zsh-autosuggestions, leading to various situations where the suggestion should be refreshed, but isn't.Typically, other plugins often create such widgets, making them incompatible with zsh-autosuggestions.
This PR changes this.
Preliminary testing seems to indicate everything works fine on my machine, and before going through more extensive testing and/or writing tests, I wanted to ask if there's a specific reason to forbid wrapping such widgets.
It looks like the current presence check is not a mistake, but a voluntary design, but I can't understand why. As far as I can tell, the only reason to ban such widget names, is to prevent wrapping an already-wrapped widget.
Which the proposed change still does.
#737 is a manifestation of this issue, and provides a nice minimal reproducing example (although the problem is bigger than stated there, as it affects all types of widget wrapping)
If we go through with this change, it would likely require a
0.8.0
tag, as suddenly starting to wrap previously-unwrapped widgets may break unexpectedly on specific edge cases. It is however possible for users with such a setup to reproduce the current behavior withZSH_AUTOSUGGEST_IGNORE_WIDGETS
, so, it's not a blocking change.Please let me know if I've missed the rationale behind the current design !