-
-
Notifications
You must be signed in to change notification settings - Fork 816
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
Additions to the InputSelector #4226
Comments
These sound like reasonable requests. If you feel like taking a crack at coding some of this, then I'd suggest starting with the alphabet, as that doesn't require changing any of the other config related structures to get it going. It should be possible to re-use the logic from quick select, which is encapsulated in this function:
You pass in the alphabet (eg: "1234567890abcdefghijklmnopqrstuvwxyz") and the number of entries in the list (or rather, the number of lines that can seen on the screen) and it will return a list of corresponding strings that represent each entry in the list. Then the logic over here in the selector that matches a label by number: wezterm/wezterm-gui/src/overlay/selector.rs Lines 186 to 190 in 99c9613
would need to be modified in a way that is similar to the quickselect logic for matching against the labels and resolving the index in the list: wezterm/wezterm-gui/src/overlay/quickselect.rs Lines 367 to 377 in 99c9613
this particular code is accumulating the keypress into a string, then looking up that string in the list of labels to see if there is a match. I'd be happy to give more feedback on a PR if you want to iterate that way! |
Why use |
I have made a pull request now: #4227 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
I am trying to use the InputSelector more for choosing from longer lists and would like a few more options.
Describe the solution you'd like
A clear and concise description of what you want to happen.
My primary suggestion is to add a longer alphabet to choose from with one click when opening the InputSelector.
Right now it only shows numbers [1-9] for the first 9 elements of the list, but it would be nice to show [1-9] for the first 9 elements and then [a-z] for the next 26 elements and possibly [A-Z] beyond that for anyone using small enough fonts to see that many elements.
Alternatively, one could choose the exact labels themselves, but this would probably require slightly more work, and I assume my first suggestion would be easier to implement.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I have also thought about jumping straight to the filter part of the InputSelector to avoid picking out elements like above. It would be nice if there was a flag "start_with_filter" (or something like that) for the InputSelector that is "false" if you want to start the InputSelector as it does now and "true" if it essentially does what would be equivalent to starting the InputSelector and then pressing "/" now.
Finally it would be nice if we were able to edit the text that currently says:
"Select an item and press Enter=accept Esc=cancel /=filter"
Additional context
Add any other context or screenshots about the feature request here.
Here is a picture where what I would like to add is "a. " in front of the line with .pylint.d, "b. " in front of the line with .ipython, and so on.
If I am pointed to the code that would need changing to implement this, I can try to take a look at it myself, but I don't really have any working experience with rust. Though I assume the above would hopefully be relatively simple?
The text was updated successfully, but these errors were encountered: