-
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
treat zle-isearch-exit like an accept-* widget #259
Conversation
My initial thought is: YAGNI. Let's just have a helper function that does How do you get path_prefix highlighting while in isearch mode? |
Done.
underlining of
Underlining stays because accepting an isearch does not call through any of the accept- widgets. However it calls zle-isearch-exit. |
Thanks, I can reproduce the issue now. However, I can also reproduce the issue under Is it even possible to write a regression test for this? I'm not sure how hard it'd be to trigger this codepath; would it be as smple as having the test-data/*.zsh file set |
Accepting a line in an iserch does not call through any of the accept-widgets. To be able to still do some cleanup (remove cursor imprint, remove partial path highlinting) use zle-isearch-exit instead.
Oh, you are right. As long as there is no zsh-isearch-exit widget loaded, this patch is not useful at all. In a clean In the case where
So it looks like |
It sounds odd that
?? |
Assuming zle-isearch-exit is indeed the last widget invoked by pressing in isearch mode, what we'd want is for z-sy-h to run code at that point. Conceptually, we'd want to Alternatively, perhaps this could be fixed through the redrawhook facility; that would require fixing the upstream issue with redrawhook and isearch (#261 (comment)) and merging one of the redrawhook-based backend implementations (#245). (And please raise that issue on -workers@ — if the redrawhook work has issues the best time to diagnose/fix them is before it's released.) |
workers/37590 invokes redrawhook from the isearch codepath, which would allow to fix this issue once the z-sy-h uses redrawhook (#245). |
This is the wrong approach for the issue. The proper way to handle these special cases is to always bind I'll re-open another pull request with a proper fix. |
Opened issue #284 to track this further. |
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
The parent commit, which merged the feature/redrawhook bug and thereby closed PR #749, also fixed the following issue: Fixes #40. Fixes #90, closes #470. (The latter is a PR for the former.) Fixes #150, closes #151, closes #160. (The latter two are PR's for the first one.) The related issue #183 appears to have been fixed in master. For #150, a different fix for older versions of zsh was considered but has not been implemented. Issue #154 was fixed in xsel(1) in 2017. The parent commit probably fixed that issue for pre-2017 xsel(1). Is #245, #356, and #749. Fixes #245 (redrawhook umbrella issue). Does not reintroduce #257 (comment). Does not reintroduce #259 (comment) Closes #281 as obsolete. Fixes #295. Fixes #324. Fixes #375. Fixes #377. Closes #421 as obsolete. Fixes #520. Unblocks #536 (already milestoned). Fixes #632. Unblocks #635. Milestoned. Unblocks #688. Milestoned. Unblocks administrative issue #655 (already milestoned). (The above is copied from #749 (comment), but repeated here for the sake of github's commit-to-issue linking magic.)
When hitting ENTER in an isearch, the cursor imprint needs to be removed, and any path_prefix highlighting needs to be removed.
See 4f0c293 and 59fbdda.
Does it make sense to keep this a a user-configurable setting? The pattern matching is a bit complex.
It is ony useful if the user has custom widgets that call accpt-* internally. But then one could argue, that the custom widget name should start with accept-, too.