-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: Support selecting candidates when completion is paged #66
Conversation
cc @tpodowd |
I'll review this over the next week or so but from a first look, the functionality is beautiful :-) |
Hi there. This does look like a nice feature. I very lightly reviewed the code and it looks good, but I haven't played with it yet. It would be nice to have a few more comments. Also, maybe we should change |
Nice! would it make sense that moving the selection when paged mode is needed does not make it wrap-around but instead moves row by row up or down? and only warps-around if moving past the "real" last or first row? and j/k could work as now i guess? |
We could distinguish the arrow keys and the tab key. Left/right arrow keys will move selection within the row and wrap to the beginning/end of that row, whereas the tab would proceed through pages. Does it sound more ergonomic to you? |
Sounds good! what about arrow keys up/down, could that move selection one row up or down and when reach start or end row of a page it scrolls one row at a time if possible and wraps if not? |
Hmm, this would require more effort because my current implementation assumes the paging structure and always starts displaying completion from the start of a page. |
Aha I see, no worries. Maybe could be something to iterate on in the future. |
Played around a bit, works fine 👍 but i wonder is the lower right entry skipped on purpose on non-last pages? |
@wader Good catch. It is a bug and I believe it's fixed now. |
Thanks, I'll plan to take a detailed look this weekend. |
Sorry about the delay. This looks good to me. Does anyone else have thoughts? |
@YangchenYe323 I merged this and tagged it as The preliminary changelog since @wader could you try testing |
@slingamn seems to work fine 👍 tried with: $ go get ...
$ go run . -ni
null> [range(10000) | {key: "a"+tostring, value: "a"+ tostring}] | from_entries | .a<tab> @YangchenYe323 nice work |
Confirm that this works for me, too. Thanks so much! |
This resolves #65
Upon reflection, I removed
PagerMode
in which the user could do nothing but view the pages and make paging a transparent feature underCompleteMode
andCompleteSelectionMode
. The benefits are:Below is a demo from the
example/readline-paged-completion
I added:Recording.2024-08-07.215104.mp4