-
Notifications
You must be signed in to change notification settings - Fork 92
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
Prefix filter search #42
Conversation
did not check black :( |
It would be cool having this merged! |
@gbataille Do you have time to fix the code style? You just need to run |
Hey,
wow, it's been a while on that. I should be although I'm on vacation. I'll
see if I can take some time on my computer
…---
Gregory Bataille
On Tue, Sep 8, 2020 at 12:51 PM Kian Cross ***@***.***> wrote:
@gbataille <https://github.com/gbataille> Do you have time to fix the
code style? You just need to run black questionary over the code.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#42 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIPX2MUJR4K3G6Z4WA3L3LSEYEBTANCNFSM4KPA3OFQ>
.
|
from prompt_toolkit.layout import ( | ||
FormattedTextControl, | ||
Layout, | ||
HSplit, | ||
ConditionalContainer, | ||
Window, | ||
) | ||
from prompt_toolkit.layout.dimension import LayoutDimension as D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better not to import as D
and instead use the full LayoutDimension
identifier.
@gbataille If you are busy, do you mind if I finish off this PR so that we can get it merged? |
Yeah I’m sorryI’m not quite on this thing anymore
Of course, please just go ahead
Thanks
On Sun, 20 Dec 2020 at 12:09, Kian Cross ***@***.***> wrote:
@gbataille <https://github.com/gbataille> If you are busy, do you mind if
I finish off this PR so that we can get it merged?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#42 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIPX2IRJPJCA2EDXWGIQADSVXLQHANCNFSM4KPA3OFQ>
.
--
Greg
|
I would love to see this feature! Thanks for the effort @gbataille |
Would love to see this feature. Any plans on merging this ? |
It would be good to get this merged, but there is a bit of work to do on the PR before that's possible. Unfortunately, I don't have time at the moment (but if anyone else does, feel free to work on it!). |
Hi, just here to say that your library is amazing, and this feature would make it just perfect. Thanks! |
This commit is heavily inspired by [gbataille's](https://github.com/gbataille) [PR](tmbo#42)
I've just created a new PR to further address this issue by adding it to the |
…#42 (#374) * feat: add search functionality to select and checkbox prompt This commit is heavily inspired by [gbataille's](https://github.com/gbataille) [PR](#42) * chore: bump minor version, because of new feature * chore: bump version in pyproject.toml * feat: changed prefix filter to search filter, allow all/invert with ctrl Instead of a prefix filter, the search filter is now searched within all entries. This seems to be more common than a prefix search. Using the search functionality disabled the ability to select all options or invert the selection in the checkbox control. If the search filter is enabled, these two functionalities can now be used with the key modifier ctrl. Updated the displayed instructions to match the changes made. * fix: reverted version bump --------- Co-authored-by: mario-dg <mario.dagraca@gmx.com>
Closed by #374. |
Fixes #33
Here is a first implementation
j
andk
) is disabledA possible alternative would be to activate the search only on a certain key, let's say
/
orCtrl+F
. Doing so, theselect
control could "change mode" like vi would, and any key type from then on, would go to the filter.Esc
could clear the filter.Enter
could either select the current entry or validate the filter and go back to navigation mode. Like that, we would not have to disable vi-like navigation.WDYT?
Note: I'd like some tests on what is displayed. I tried with a
prompt-toolkit
Output
but the string rendered is a bit messy and validation would be awkward. I think it might be worth adding tests directly to theInquirerControl
and the tokens it returns or theprompt-toolkit
Layout
it calls.I might have a look into it if/when we agree on the implementation for this feature