-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
driver: Highlight even after a widget returns non-zero #470
Conversation
As discussed on IRC: The I guess the rationale is that after a general widget returns an error, "Do no harm" kicks in so we avoid setting $region_highlight since we don't know that zle's in a defined state. Can we distinguish "Completion had no matches" from "Completion had an error"? E.g., for completion widgets, check ${compstate[nmatches]}, or something... (maybe ask zsh-users@) Thinking out loud — how about if we restrict this to completion widgets? E.g., those that appear in |
14546b3
to
a5579e1
Compare
a5579e1
to
ba58d68
Compare
The incumbent behaviour is actually useful, in a way: typing Sure, in a way that's an upstream bug (unclear error reporting), but leaving the command word green might nevertheless be a usability regression. /cc @blueyed (context: discussion on #zsh today) |
If we change this it would be good to expose the wrappee's code to highlighters, e.g., — _zsh_highlight_call_widget()
{
- builtin zle "$@" &&
+ builtin zle "$@"
+ local zsh_highlight_wrappee_status=$?
_zsh_highlight
+ return zsh_highlight_wrappee_status
} — although actually reporting the error condition isn't our responsibility (it's the responsibility of the wrappee, and it doesn't communicate the error to the user through $region_highlight so we don't step on its toes). |
ba58d68
to
326b174
Compare
Asked upstream in users/23100. |
326b174
to
4a1d77f
Compare
zsh master does print a warning nowadays, doesn't it? Which would address the above 'usability regression' point. |
There was a mailed patch to |
4a1d77f
to
b9d8ab1
Compare
This needs some thought and discussion before (if) merging. May have yet unconsidered unintended side effects.
Closes #90.