PyInquirer icon indicating copy to clipboard operation
PyInquirer copied to clipboard

pagination for long list of options

Open manihamidi opened this issue 6 years ago • 5 comments

Thank you for this wonderful library.

Was wondering if there is a way to paginate a long list of options?

Alternatively, is there a way to have the list of options printed in multiple columns so as to fit as many options in the smallest rectangular space on the console as possible?

:question:

manihamidi avatar Mar 22 '19 19:03 manihamidi

Give more example

CITGuru avatar Mar 24 '19 05:03 CITGuru

I mean something like what ipython does:

Mar-24-2019 13-08-52

That is,

a) Instead of listing the options vertically one below the other, list them in a rectangular fashion (kind of like the default console ls output) and b) Instead of printing all of the options onto the screen at once, limit the vertical width of the rectangle and "paginate" whatever doesn't fit in the rectangle in view, i.e. allow user to scroll through to the next "page" of the the "choices" by clicking the right arrow key.

Does that make sense?

If the feature doesn't exist already, let me know if/how I can help.

manihamidi avatar Mar 24 '19 20:03 manihamidi

This is more like a new feature. I'll be glad if you are able to send a PR on this.

CITGuru avatar Mar 25 '19 18:03 CITGuru

Thanks, I'll give it a shot.

manihamidi avatar Mar 25 '19 20:03 manihamidi

Coool, I will be on look out

CITGuru avatar Mar 26 '19 00:03 CITGuru