firecat53 / urlscan

Mutt and terminal url selector (similar to urlview)
GNU General Public License v2.0
214 stars 38 forks source link

Crash when going to non-existent line number after search #118

Closed firecat53 closed 2 years ago

firecat53 commented 3 years ago

After search, which limits the line numbers to items containing the search terms, if a number is pushed to go to a currently non-existent line number, urlscan crashes with:

Traceback (most recent call last):
  File "/home/firecat53/.local/bin/urlscan", line 8, in <module>
    sys.exit(main())
  File "/home/firecat53/.local/lib/python3.9/site-packages/urlscan/__main__.py", line 185, in main
    tui.main()
  File "/home/firecat53/.local/lib/python3.9/site-packages/urlscan/urlchoose.py", line 255, in main
    self.loop.run()
  File "/home/firecat53/.local/lib/python3.9/site-packages/urwid/main_loop.py", line 287, in run
    self._run()
  File "/home/firecat53/.local/lib/python3.9/site-packages/urwid/main_loop.py", line 380, in _run
    return self._run_screen_event_loop()
  File "/home/firecat53/.local/lib/python3.9/site-packages/urwid/main_loop.py", line 448, in _run_screen_event_loop
    self.process_input(keys)
  File "/home/firecat53/.local/lib/python3.9/site-packages/urwid/main_loop.py", line 519, in process_input
    something_handled |= bool(self.unhandled_input(k))
  File "/home/firecat53/.local/lib/python3.9/site-packages/urwid/main_loop.py", line 565, in unhandled_input
    return self._unhandled_input(input)
  File "/home/firecat53/.local/lib/python3.9/site-packages/urlscan/urlchoose.py", line 331, in unhandled
    self.keys[key]()
  File "/home/firecat53/.local/lib/python3.9/site-packages/urlscan/urlchoose.py", line 410, in _digits
    self.items.index(self.items_com[max(int(self.number) - 1, 0)])
ValueError: <Columns selectable box/flow widget> is not in list