Skip to content
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

Long lists issue #2

Closed
mostafahussein opened this issue Jan 19, 2016 · 5 comments · Fixed by #3
Closed

Long lists issue #2

mostafahussein opened this issue Jan 19, 2016 · 5 comments · Fixed by #3
Assignees
Labels

Comments

@mostafahussein
Copy link

I have an issue with pick while passing a long list, here is an example you can try it:

from pick import pick

title = 'Select: '
options = ['foo.bar1.baz', 'foo.bar2.baz', 'foo.bar3.baz', 'foo.bar4.baz', 'foo.bar5.baz', 'foo.bar6.baz', 'foo.bar7.baz','foo.bar8.baz', 'foo.bar9.baz', 'foo.bar10.baz','foo.bar11.baz', 'foo.bar12.baz', 'foo.bar13.baz', 'foo.bar14.baz', 'foo.bar15.baz', 'foo.bar16.baz', 'foo.bar17.baz','foo.bar18.baz', 'foo.bar19.baz', 'foo.bar20.baz','foo.bar21.baz', 'foo.bar22.baz', 'foo.bar23.baz', 'foo.bar24.baz', 'foo.bar25.baz', 'foo.bar26.baz', 'foo.bar27.baz','foo.bar28.baz', 'foo.bar29.baz', 'foo.bar30.baz','foo.bar31.baz', 'foo.bar32.baz', 'foo.bar33.baz', 'foo.bar34.baz', 'foo.bar35.baz', 'foo.bar36.baz', 'foo.bar37.baz','foo.bar38.baz', 'foo.bar39.baz', 'foo.bar40.baz','foo.bar41.baz', 'foo.bar42.baz', 'foo.bar43.baz', 'foo.bar44.baz', 'foo.bar45.baz', 'foo.bar46.baz', 'foo.bar47.baz','foo.bar48.baz', 'foo.bar49.baz', 'foo.bar50.baz','foo.bar51.baz', 'foo.bar52.baz', 'foo.bar53.baz', 'foo.bar54.baz', 'foo.bar55.baz', 'foo.bar56.baz', 'foo.bar57.baz','foo.bar58.baz', 'foo.bar59.baz', 'foo.bar60.baz']
option, index = pick(options, title)

the result will be:

Traceback (most recent call last):
  File "pick_test.py", line 5, in <module>
    option, index = pick(options, title)
  File "/usr/lib/python2.7/site-packages/pick/__init__.py", line 109, in pick
    return picker.start()
  File "/usr/lib/python2.7/site-packages/pick/__init__.py", line 73, in start
    return curses.wrapper(self.run_loop)
  File "/usr/lib64/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/lib/python2.7/site-packages/pick/__init__.py", line 84, in run_loop
    self.draw()
  File "/usr/lib/python2.7/site-packages/pick/__init__.py", line 67, in draw
    self.screen.addstr(y, x, line)
_curses.error: addstr() returned ERR
@wong2 wong2 added the bug label Jan 20, 2016
@wong2
Copy link
Collaborator

wong2 commented Jan 20, 2016

confirmed, will try to fix it today

@wong2
Copy link
Collaborator

wong2 commented Jan 20, 2016

@mostafahussein I've fixed this issue, plz upgrade to 0.4.0 and try again

@mostafahussein
Copy link
Author

@wong2 it works correctly, thanks !
Is there anyway to highlight the current selection ?!

@wong2
Copy link
Collaborator

wong2 commented Jan 20, 2016

@mostafahussein you mean highlight the whole line with a background color?

@mostafahussein
Copy link
Author

i am not sure if highlighting the text itself or highlighting the background of a line would be better and easier to read

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants