-
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
fixes for zle handling #288
Conversation
8769280
to
9e32fef
Compare
Should Stylistically, I prefer troubleshooting.md: please link to the relevant section of zshzle(1). Since docs:
I haven't tested the fifth commit yet. |
I don't think that this is necessary. The function is only used internally, and even with a check for
I do, too. But most of
I dropped the whole commit excluding
So I also rolled back the
I improved the wording of that paragraph (which can now be found in the FAQ in
Fixed.
The failure from that comment does not apply anymore now that we always bind |
Rebased. |
245a803
to
a6c1e86
Compare
Changed the last commit about isearch. Removed the zsh-5.3-specific fallback. We can track that separately. |
702528b
to
6fbeac3
Compare
Review of current branch (6fbeac3):
Sorry for the long delay — it is entirely my fault. I look forward to merging the first two commits as soon as they're ready (even if the third commit might then need another iteration). |
Checklist (for me to review pre-merge):
After merge:
|
Old version can be found here: https://github.com/m0vie/zsh-syntax-highlighting/tree/p_allzlefixes_old
Done.
Done I agree that the code should be unified. I changed it in the latest version. Now, in |
If a special zle-* hook is currently unbound, there is no entry in $widgets. Support that case by adding a new case branch.
Special handling for cursor imprint or partial path highlighting is needed in more cases than accept-*. For example when accepting a line from isearch, no accept-* widget is invoked. The proper way is to use zle-line-finish. Trumps zsh-users#259. Fixes zsh-users#284.
zsh version 5.2 and lower don't support ISEARCHMATCH_ACTIE and we are unable to re-apply zle_highlight on top. Therefore it is impossible to see the underlined matched area. Since that information is more important, completely disable highlighting in isearch in that case. To do that, we need to make sure we are actually called when something changes in isearch. Trumps zsh-users#257.
Sorry for the very long delay ☹ Review (of 56b81a9):
|
Thinking ahead, that commit adds I don't think this consideration affects this branch, though; it's just something the other branches will need to do after 8dfe7b0 is merged. edit: This also applies to |
I've implemented the suggestions from my penultimate comment on a branch: https://github.com/zsh-users/zsh-syntax-highlighting/compare/master...danielshahaf:m0vie-i288-v2?expand=1 I dropped the link to the "API for zsh5.3 concerning ISEARCHMATCH_ACTIVE" thread since it didn't seem relevant to the comment next to it (the thread is about 5.3 behaviour but the code is about 5.2 support); did you mean to link to a different thread? I dropped the explanation from the first log message since upstream now documents that (commit users/21752: zsh-users/zsh@18d676f). |
Thank you for taking care of it. I'm very busy lately and didn't have time to look at it. I agree with all the changes you made. Just two small typos left: "Under those version of zsh it is not possible for..." "Bind to z-sy-h driectly." Should I update this PR again, or are you going to merge your changes? |
Fixed both and force-pushed my branch. Thanks for the review. My plan is first of all to get Re updating the PR, feel free: Quick question, what do you think of limiting the new codepath master...danielshahaf:m0vie-i288-v2#diff-4ed73021a0fa2ff4e78a9909f4fc2f9bR299 to |
@phy1729 If you have a moment I'd love a third pair of eyes over the upcoming FAQ entry: master...danielshahaf:m0vie-i288-v2#diff-04c6e90faac2675aa89e2176d2eec7d8R35 Thanks! |
Sounds like a good idea to be on the safe side!
OK, I'll update it with your changes later. |
I wrote a quick draft of this and appended it to the branch.
Okay. I've stopped making changes to the branch here; the mutex is yours. |
Compare issue zsh-users#288.
This patch causes a behaviour difference in the [i257] scenario: - Before this change, the zle_highlight[isearch] is applied and z-sy-h's highlighting isn't. - With this change, both zle_highlight[isearch] and z-sy-h's highlighting are applied, so «echo foo» renders the first word in green underline (fg=green from ZSH_HIGHLIGHT_STYLES[builtin], underline from zle_highlight[isearch]). This patch causes the presuppositional FAQ entry added in a8fe22d to be correct. This is part of #261, of which #288 was a spin-off. [i257] #257 (comment)
Merged in 171a4ee |
And after the merge 4ad311e was committed, q.v.. |
Compare issue zsh-users#288.
Compare issue zsh-users#288.
New pull request replacing #257 and providing a proper solution for what #259 tried to do.